From: abd Date: Fri, 10 Oct 2008 10:01:32 +0000 (+0000) Subject: Merging from V4_1_0_maintainance for porting on Win32 Platform X-Git-Tag: V5_1_0a3~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fd34d295755a0494910172324d19b2e64f3febea;p=modules%2Fkernel.git Merging from V4_1_0_maintainance for porting on Win32 Platform --- diff --git a/src/Batch/Batch_BatchManager.cxx b/src/Batch/Batch_BatchManager.cxx index 3fb947250..650642008 100644 --- a/src/Batch/Batch_BatchManager.cxx +++ b/src/Batch/Batch_BatchManager.cxx @@ -29,7 +29,7 @@ #include #include #include -#ifdef WNT +#ifdef WIN32 # include #else # include diff --git a/src/Batch/Batch_BatchManager_LSF.cxx b/src/Batch/Batch_BatchManager_LSF.cxx index 301f2eeb0..29f17e21e 100644 --- a/src/Batch/Batch_BatchManager_LSF.cxx +++ b/src/Batch/Batch_BatchManager_LSF.cxx @@ -34,8 +34,11 @@ extern "C" { #include #include #include +#include #include "Batch_BatchManager_LSF.hxx" +using namespace std; + namespace Batch { BatchManager_LSF::BatchManager_LSF(const FactBatchManager * parent, const char * host) throw(InvalidArgumentException,ConnexionFailureException) : BatchManager(parent, host) diff --git a/src/Batch/Batch_BatchManager_Local.cxx b/src/Batch/Batch_BatchManager_Local.cxx index 46b1f9463..049e2afce 100644 --- a/src/Batch/Batch_BatchManager_Local.cxx +++ b/src/Batch/Batch_BatchManager_Local.cxx @@ -45,6 +45,8 @@ #include "Batch_IOMutex.hxx" #include "Batch_BatchManager_Local.hxx" +using namespace std; + namespace Batch { diff --git a/src/Batch/Batch_BatchManager_Local.hxx b/src/Batch/Batch_BatchManager_Local.hxx index e6d969c82..d797aaf28 100644 --- a/src/Batch/Batch_BatchManager_Local.hxx +++ b/src/Batch/Batch_BatchManager_Local.hxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include "Batch_Job.hxx" #include "Batch_JobId.hxx" @@ -92,7 +91,7 @@ namespace Batch { struct Child { pthread_t thread_id; - queue > command_queue; + std::queue > command_queue; pid_t pid; int exit_code; Status status; @@ -128,16 +127,20 @@ namespace Batch { protected: int _connect; // Local connect id pthread_mutex_t _threads_mutex; - map _threads; + std::map _threads; // Methode abstraite qui renvoie la commande de copie du fichier source en destination - virtual string copy_command(const string & host_source, const string & source, const string & host_destination, const string & destination) const = 0; + virtual std::string copy_command( const std::string & host_source, + const std::string & source, + const std::string & host_destination, + const std::string & destination) const = 0; // Methode abstraite qui renvoie la commande a executer - virtual string exec_command(Parametre & param) const = 0; + virtual std::string exec_command(Parametre & param) const = 0; // Methode abstraite qui renvoie la commande d'effacement du fichier - virtual string remove_command(const string & host_destination, const string & destination) const = 0; + virtual std::string remove_command( const std::string & host_destination, + const std::string & destination) const = 0; private: virtual pthread_t submit(const Job_Local & job); @@ -151,7 +154,7 @@ namespace Batch { pthread_cond_t _thread_id_id_association_cond; #ifndef WIN32 //TODO: porting of following functionality //reason: pthread_t on win32 is a struct of pointer and int members - map _thread_id_id_association; + std::map _thread_id_id_association; #endif #ifdef SWIG diff --git a/src/Batch/Batch_BatchManager_Local_RSH.cxx b/src/Batch/Batch_BatchManager_Local_RSH.cxx index ea2a66e4e..a99a9cdcd 100644 --- a/src/Batch/Batch_BatchManager_Local_RSH.cxx +++ b/src/Batch/Batch_BatchManager_Local_RSH.cxx @@ -59,6 +59,8 @@ #error "RSH undefined. You must set RSH to a valid path to a rsh-like command." #endif +using namespace std; + namespace Batch { diff --git a/src/Batch/Batch_BatchManager_Local_RSH.hxx b/src/Batch/Batch_BatchManager_Local_RSH.hxx index f71459260..0580a4aad 100644 --- a/src/Batch/Batch_BatchManager_Local_RSH.hxx +++ b/src/Batch/Batch_BatchManager_Local_RSH.hxx @@ -60,13 +60,17 @@ namespace Batch { protected: // Methode abstraite qui renvoie la commande de copie du fichier source en destination - virtual string copy_command(const string & host_source, const string & source, const string & host_destination, const string & destination) const; + virtual std::string copy_command( const std::string & host_source, + const std::string & source, + const std::string & host_destination, + const std::string & destination) const; // Methode abstraite qui renvoie la commande a executer - virtual string exec_command(Parametre & param) const; + virtual std::string exec_command(Parametre & param) const; // Methode qui renvoie la commande d'effacement du fichier - virtual string remove_command(const string & host_destination, const string & destination) const; + virtual std::string remove_command( const std::string & host_destination, + const std::string & destination) const; }; diff --git a/src/Batch/Batch_BatchManager_Local_SH.cxx b/src/Batch/Batch_BatchManager_Local_SH.cxx index f543c47d5..beead5209 100644 --- a/src/Batch/Batch_BatchManager_Local_SH.cxx +++ b/src/Batch/Batch_BatchManager_Local_SH.cxx @@ -59,6 +59,8 @@ #error "SH undefined. You must set SH to a valid path to a sh-like command." #endif +using namespace std; + namespace Batch { diff --git a/src/Batch/Batch_BatchManager_Local_SH.hxx b/src/Batch/Batch_BatchManager_Local_SH.hxx index bd28a28aa..31f79b2aa 100644 --- a/src/Batch/Batch_BatchManager_Local_SH.hxx +++ b/src/Batch/Batch_BatchManager_Local_SH.hxx @@ -60,13 +60,17 @@ namespace Batch { protected: // Methode qui renvoie la commande de copie du fichier source en destination - virtual string copy_command(const string & host_source, const string & source, const string & host_destination, const string & destination) const; + virtual std::string copy_command( const std::string & host_source, + const std::string & source, + const std::string & host_destination, + const std::string & destination) const; // Methode qui renvoie la commande a executer - virtual string exec_command(Parametre & param) const; + virtual std::string exec_command(Parametre & param) const; // Methode qui renvoie la commande d'effacement du fichier - virtual string remove_command(const string & host_destination, const string & destination) const; + virtual std::string remove_command( const std::string & host_destination, + const std::string & destination) const; }; diff --git a/src/Batch/Batch_BatchManager_Local_SSH.cxx b/src/Batch/Batch_BatchManager_Local_SSH.cxx index 9f77016e2..697c9ea2f 100644 --- a/src/Batch/Batch_BatchManager_Local_SSH.cxx +++ b/src/Batch/Batch_BatchManager_Local_SSH.cxx @@ -60,6 +60,8 @@ #error "SSH undefined. You must set SSH to a valid path to a ssh-like command." #endif +using namespace std; + namespace Batch { diff --git a/src/Batch/Batch_BatchManager_Local_SSH.hxx b/src/Batch/Batch_BatchManager_Local_SSH.hxx index 5d6c89c7b..33ecda42d 100644 --- a/src/Batch/Batch_BatchManager_Local_SSH.hxx +++ b/src/Batch/Batch_BatchManager_Local_SSH.hxx @@ -60,13 +60,17 @@ namespace Batch { protected: // Methode abstraite qui renvoie la commande de copie du fichier source en destination - virtual string copy_command(const string & host_source, const string & source, const string & host_destination, const string & destination) const; + virtual std::string copy_command( const std::string & host_source, + const std::string & source, + const std::string & host_destination, + const std::string & destination) const; // Methode abstraite qui renvoie la commande a executer - virtual string exec_command(Parametre & param) const; + virtual std::string exec_command(Parametre & param) const; // Methode qui renvoie la commande d'effacement du fichier - virtual string remove_command(const string & host_destination, const string & destination) const; + virtual std::string remove_command( const std::string & host_destination, + const std::string & destination) const; }; diff --git a/src/Batch/Batch_BatchManager_eClient.cxx b/src/Batch/Batch_BatchManager_eClient.cxx index 9a199e9b7..a005cec9c 100644 --- a/src/Batch/Batch_BatchManager_eClient.cxx +++ b/src/Batch/Batch_BatchManager_eClient.cxx @@ -27,12 +27,16 @@ * */ +#include "Batch_BatchManager_eClient.hxx" +#include "Basics_DirUtils.hxx" + #include #include #include #include -#include "Batch_BatchManager_eClient.hxx" -#include "OpUtil.hxx" + +using namespace std; + namespace Batch { @@ -204,7 +208,7 @@ namespace Batch { string BatchManager_eClient::BuildTemporaryFileName() const { //build more complex file name to support multiple salome session - string aFileName = OpUtil_Dir::GetTmpFileName(); + string aFileName = Kernel_Utils::GetTmpFileName(); #ifndef WIN32 aFileName += ".sh"; #else diff --git a/src/Batch/Batch_BatchManager_eClient.hxx b/src/Batch/Batch_BatchManager_eClient.hxx index ca84efdb4..f3d27c406 100644 --- a/src/Batch/Batch_BatchManager_eClient.hxx +++ b/src/Batch/Batch_BatchManager_eClient.hxx @@ -35,6 +35,8 @@ #include "MpiImpl.hxx" #include "Batch_BatchManager.hxx" +#include + namespace Batch { class Job; @@ -62,7 +64,7 @@ namespace Batch { std::string BuildTemporaryFileName() const; void RmTmpFile(std::string & TemporaryFileName); - MpiImpl* FactoryMpiImpl(string mpiImpl) throw(EmulationException); + MpiImpl* FactoryMpiImpl(std::string mpiImpl) throw(EmulationException); void exportInputFiles(const Job & job) throw(EmulationException); private: diff --git a/src/Batch/Batch_BatchManager_eLSF.cxx b/src/Batch/Batch_BatchManager_eLSF.cxx index 46552a015..2533a3186 100644 --- a/src/Batch/Batch_BatchManager_eLSF.cxx +++ b/src/Batch/Batch_BatchManager_eLSF.cxx @@ -37,6 +37,8 @@ # include #endif +using namespace std; + namespace Batch { BatchManager_eLSF::BatchManager_eLSF(const FactBatchManager * parent, const char * host, const char * protocol, const char * mpiImpl) throw(InvalidArgumentException,ConnexionFailureException) : BatchManager_eClient(parent,host,protocol,mpiImpl) diff --git a/src/Batch/Batch_BatchManager_ePBS.cxx b/src/Batch/Batch_BatchManager_ePBS.cxx index d806ddae3..fa612adda 100644 --- a/src/Batch/Batch_BatchManager_ePBS.cxx +++ b/src/Batch/Batch_BatchManager_ePBS.cxx @@ -37,6 +37,8 @@ # include #endif +using namespace std; + namespace Batch { BatchManager_ePBS::BatchManager_ePBS(const FactBatchManager * parent, const char * host, const char * protocol, const char * mpiImpl) throw(InvalidArgumentException,ConnexionFailureException) : BatchManager_eClient(parent,host,protocol,mpiImpl) diff --git a/src/Batch/Batch_FactBatchManager_LSF.hxx b/src/Batch/Batch_FactBatchManager_LSF.hxx index 718a068fc..239b8edfd 100644 --- a/src/Batch/Batch_FactBatchManager_LSF.hxx +++ b/src/Batch/Batch_FactBatchManager_LSF.hxx @@ -29,9 +29,6 @@ #ifndef _FACTBATCHMANAGER_LSF_H_ #define _FACTBATCHMANAGER_LSF_H_ -using namespace std; -#include -#include #include "Batch_FactBatchManager.hxx" namespace Batch { diff --git a/src/Batch/Batch_FactBatchManager_Local.hxx b/src/Batch/Batch_FactBatchManager_Local.hxx index 77b5d11b3..f9b0d20df 100644 --- a/src/Batch/Batch_FactBatchManager_Local.hxx +++ b/src/Batch/Batch_FactBatchManager_Local.hxx @@ -28,9 +28,6 @@ #ifndef _FACTBATCHMANAGER_LOCAL_H_ #define _FACTBATCHMANAGER_LOCAL_H_ -using namespace std; -#include -#include #include "Batch_FactBatchManager.hxx" namespace Batch { diff --git a/src/Batch/Batch_FactBatchManager_Local_RSH.hxx b/src/Batch/Batch_FactBatchManager_Local_RSH.hxx index bf10abd14..1f68befd1 100644 --- a/src/Batch/Batch_FactBatchManager_Local_RSH.hxx +++ b/src/Batch/Batch_FactBatchManager_Local_RSH.hxx @@ -28,9 +28,6 @@ #ifndef _FACTBATCHMANAGER_LOCAL_RSH_H_ #define _FACTBATCHMANAGER_LOCAL_RSH_H_ -using namespace std; -#include -#include #include "Batch_FactBatchManager.hxx" namespace Batch { diff --git a/src/Batch/Batch_FactBatchManager_Local_SH.hxx b/src/Batch/Batch_FactBatchManager_Local_SH.hxx index 8ac703a74..29ff50d07 100644 --- a/src/Batch/Batch_FactBatchManager_Local_SH.hxx +++ b/src/Batch/Batch_FactBatchManager_Local_SH.hxx @@ -28,9 +28,6 @@ #ifndef _FACTBATCHMANAGER_LOCAL_SH_H_ #define _FACTBATCHMANAGER_LOCAL_SH_H_ -using namespace std; -#include -#include #include "Batch_FactBatchManager.hxx" namespace Batch { diff --git a/src/Batch/Batch_FactBatchManager_Local_SSH.hxx b/src/Batch/Batch_FactBatchManager_Local_SSH.hxx index 2c3c14e03..4d9764247 100644 --- a/src/Batch/Batch_FactBatchManager_Local_SSH.hxx +++ b/src/Batch/Batch_FactBatchManager_Local_SSH.hxx @@ -28,9 +28,6 @@ #ifndef _FACTBATCHMANAGER_LOCAL_SSH_H_ #define _FACTBATCHMANAGER_LOCAL_SSH_H_ -using namespace std; -#include -#include #include "Batch_FactBatchManager.hxx" namespace Batch { diff --git a/src/Batch/Batch_JobInfo.cxx b/src/Batch/Batch_JobInfo.cxx index 6e985fdb2..71fe3113b 100644 --- a/src/Batch/Batch_JobInfo.cxx +++ b/src/Batch/Batch_JobInfo.cxx @@ -33,6 +33,8 @@ //#include "MEDMEM_STRING.hxx" #include "Batch_JobInfo.hxx" +using namespace std; + namespace Batch { // Destructeur diff --git a/src/Batch/Batch_JobInfo.hxx b/src/Batch/Batch_JobInfo.hxx index bb9c50b12..cfcd05251 100644 --- a/src/Batch/Batch_JobInfo.hxx +++ b/src/Batch/Batch_JobInfo.hxx @@ -52,7 +52,7 @@ namespace Batch { JobInfo(const JobInfo & jinfo) : _param(jinfo._param), _env(jinfo._env) {}; // Operateur pour l'affichage sur un stream - friend ostream & operator <<(ostream & os, const JobInfo & ji); + friend std::ostream & operator <<(std::ostream & os, const JobInfo & ji); // Accesseurs // _CS_gbo Ajout explicite du namespace pour les besoins de swig (mauvaise gestion @@ -62,8 +62,8 @@ namespace Batch { // Methodes pour l'interfacage avec Python (SWIG) // TODO : supprimer ces methodes et transferer leur definitions dans SWIG - string __str__() const; // SWIG : affichage en Python - string __repr__() const { return __str__(); }; // SWIG : affichage en Python + std::string __str__() const; // SWIG : affichage en Python + std::string __repr__() const { return __str__(); }; // SWIG : affichage en Python protected: Parametre _param; // parametres du job diff --git a/src/Batch/Batch_JobInfo_LSF.cxx b/src/Batch/Batch_JobInfo_LSF.cxx index 2ae986cd0..79f5d3807 100644 --- a/src/Batch/Batch_JobInfo_LSF.cxx +++ b/src/Batch/Batch_JobInfo_LSF.cxx @@ -29,12 +29,15 @@ #include #include +#include #include "Batch_Parametre.hxx" #include "Batch_Environnement.hxx" #include "Batch_RunTimeException.hxx" #include "Batch_APIInternalFailureException.hxx" #include "Batch_JobInfo_LSF.hxx" +using namespace std; + namespace Batch { diff --git a/src/Batch/Batch_JobInfo_LSF.hxx b/src/Batch/Batch_JobInfo_LSF.hxx index 7ba666211..1edb2e52d 100644 --- a/src/Batch/Batch_JobInfo_LSF.hxx +++ b/src/Batch/Batch_JobInfo_LSF.hxx @@ -57,15 +57,15 @@ namespace Batch { // Methodes pour l'interfacage avec Python (SWIG) // TODO : supprimer ces methodes et transferer leur definitions dans SWIG - string __str__() const; // SWIG : affichage en Python - string __repr__() const { return __str__(); }; // SWIG : affichage en Python + std::string __str__() const; // SWIG : affichage en Python + std::string __repr__() const { return __str__(); }; // SWIG : affichage en Python protected: bool _running; // etat du job en machine private: // Convertit une date HH:MM:SS en secondes - long HMStoLong(const string &); + long HMStoLong(const std::string &); }; diff --git a/src/Batch/Batch_JobInfo_eLSF.cxx b/src/Batch/Batch_JobInfo_eLSF.cxx index 177f2eb06..5edeb0a5b 100644 --- a/src/Batch/Batch_JobInfo_eLSF.cxx +++ b/src/Batch/Batch_JobInfo_eLSF.cxx @@ -37,6 +37,8 @@ #include "Batch_APIInternalFailureException.hxx" #include "Batch_JobInfo_eLSF.hxx" +using namespace std; + namespace Batch { diff --git a/src/Batch/Batch_JobInfo_eLSF.hxx b/src/Batch/Batch_JobInfo_eLSF.hxx index 51d3f6fd3..52b7282cf 100644 --- a/src/Batch/Batch_JobInfo_eLSF.hxx +++ b/src/Batch/Batch_JobInfo_eLSF.hxx @@ -30,10 +30,11 @@ #ifndef _JOBINFO_LSF_H_ #define _JOBINFO_LSF_H_ -#include #include "Batch_RunTimeException.hxx" #include "Batch_JobInfo.hxx" +#include + namespace Batch { class JobInfo_eLSF : public JobInfo @@ -52,15 +53,15 @@ namespace Batch { // Methodes pour l'interfacage avec Python (SWIG) // TODO : supprimer ces methodes et transferer leur definitions dans SWIG - string __str__() const; // SWIG : affichage en Python - string __repr__() const { return __str__(); }; // SWIG : affichage en Python + std::string __str__() const; // SWIG : affichage en Python + std::string __repr__() const { return __str__(); }; // SWIG : affichage en Python protected: bool _running; // etat du job en machine private: // Convertit une date HH:MM:SS en secondes - long HMStoLong(const string &); + long HMStoLong(const std::string &); }; diff --git a/src/Batch/Batch_JobInfo_ePBS.cxx b/src/Batch/Batch_JobInfo_ePBS.cxx index 6d9807a0c..8a1c97506 100644 --- a/src/Batch/Batch_JobInfo_ePBS.cxx +++ b/src/Batch/Batch_JobInfo_ePBS.cxx @@ -37,6 +37,8 @@ #include "Batch_APIInternalFailureException.hxx" #include "Batch_JobInfo_ePBS.hxx" +using namespace std; + namespace Batch { diff --git a/src/Batch/Batch_JobInfo_ePBS.hxx b/src/Batch/Batch_JobInfo_ePBS.hxx index 79fb0b782..03a8601aa 100644 --- a/src/Batch/Batch_JobInfo_ePBS.hxx +++ b/src/Batch/Batch_JobInfo_ePBS.hxx @@ -52,15 +52,15 @@ namespace Batch { // Methodes pour l'interfacage avec Python (SWIG) // TODO : supprimer ces methodes et transferer leur definitions dans SWIG - string __str__() const; // SWIG : affichage en Python - string __repr__() const { return __str__(); }; // SWIG : affichage en Python + std::string __str__() const; // SWIG : affichage en Python + std::string __repr__() const { return __str__(); }; // SWIG : affichage en Python protected: bool _running; // etat du job en machine private: // Convertit une date HH:MM:SS en secondes - long HMStoLong(const string &); + long HMStoLong(const std::string &); }; diff --git a/src/Batch/Batch_Job_LSF.cxx b/src/Batch/Batch_Job_LSF.cxx index 549d4ab36..2d99df052 100644 --- a/src/Batch/Batch_Job_LSF.cxx +++ b/src/Batch/Batch_Job_LSF.cxx @@ -30,10 +30,12 @@ #include #include #include -#include +#include #include #include "Batch_Job_LSF.hxx" +using namespace std; + namespace Batch { diff --git a/src/Batch/Batch_Job_LSF.hxx b/src/Batch/Batch_Job_LSF.hxx index 0de536514..9bc07fa1b 100644 --- a/src/Batch/Batch_Job_LSF.hxx +++ b/src/Batch/Batch_Job_LSF.hxx @@ -35,6 +35,7 @@ extern "C" { #include #include } +#include #include "Batch_Job.hxx" namespace Batch { @@ -54,7 +55,7 @@ namespace Batch { private: struct submit * ParametreToSubmitStruct(const Parametre & P); - char * string2char(const string &); + char * string2char(const std::string &); }; } diff --git a/src/Batch/Batch_Job_Local.cxx b/src/Batch/Batch_Job_Local.cxx index 74401458e..896532c96 100644 --- a/src/Batch/Batch_Job_Local.cxx +++ b/src/Batch/Batch_Job_Local.cxx @@ -33,6 +33,8 @@ #endif #include "Batch_Job_Local.hxx" +using namespace std; + namespace Batch { // Constructeur diff --git a/src/Batch/Batch_NotYetImplementedException.hxx b/src/Batch/Batch_NotYetImplementedException.hxx index 2ca75a1e1..509aceaca 100644 --- a/src/Batch/Batch_NotYetImplementedException.hxx +++ b/src/Batch/Batch_NotYetImplementedException.hxx @@ -31,10 +31,9 @@ #define _NOTYETIMPLEMENTEDEXCEPTION_H_ #include "Batch_Defines.hxx" - - #include "Batch_GenericException.hxx" -using namespace std; + +#include namespace Batch { @@ -42,7 +41,7 @@ namespace Batch { { public: // Constructeur - NotYetImplementedException(string ch = "undefined") : GenericException("NotYetImplementedException", ch) {} + NotYetImplementedException(std::string ch = "undefined") : GenericException("NotYetImplementedException", ch) {} }; } diff --git a/src/Batch/Batch_Parametre.cxx b/src/Batch/Batch_Parametre.cxx index b218cc443..1facc6287 100644 --- a/src/Batch/Batch_Parametre.cxx +++ b/src/Batch/Batch_Parametre.cxx @@ -26,11 +26,12 @@ * */ -#include #include "Batch_Versatile.hxx" #include "Batch_InvalidKeyException.hxx" #include "Batch_Parametre.hxx" +using namespace std; + // Definition des membres constants statiques // Definition des noms globaux pour les clefs en tant que references // TODO : supprimer les declarations statiques des clefs de la map diff --git a/src/Batch/Batch_Parametre.hxx b/src/Batch/Batch_Parametre.hxx index ea2bd8f09..e6feedf9c 100644 --- a/src/Batch/Batch_Parametre.hxx +++ b/src/Batch/Batch_Parametre.hxx @@ -36,20 +36,18 @@ #include "Batch_InvalidKeyException.hxx" #include "Batch_Versatile.hxx" -using namespace std; - // Ces macros permettent de simplifier l'ajout de nouvelles // clefs dans la map Parametre // TODO : remplacer ce mecanisme statique par la lecture // TODO : d'une descrption dans un fichier exterieur (genre XML) -#define def_extern_MapKey(mk) extern BATCH_EXPORT const string & mk; -#define def_static_MapKey(mk) const string Batch::Parametre::mk(#mk); \ - const string & mk = Batch::Parametre::mk; +#define def_extern_MapKey(mk) extern BATCH_EXPORT const std::string & mk; +#define def_static_MapKey(mk) const std::string Batch::Parametre::mk(#mk); \ + const std::string & mk = Batch::Parametre::mk; namespace Batch { - class BATCH_EXPORT Parametre : public map< string, Versatile > + class BATCH_EXPORT Parametre : public std::map< std::string, Versatile > { public: // Constructeur standard @@ -59,56 +57,56 @@ namespace Batch { Parametre(const Parametre & PM); // Operateur de recherche dans la map - Versatile & operator [] (const string &); - const Versatile & operator [] (const string &) const; + Versatile & operator [] (const std::string &); + const Versatile & operator [] (const std::string &) const; // Operateur d'affectation Parametre & operator =(const Parametre & PM); // Declarations statique des clefs de la map // TODO : supprimer les declarations statiques des clefs de la map - static const string ACCOUNT; - static const string ARGUMENTS; - static const string CHECKPOINT; - static const string CKPTINTERVAL; - static const string CREATIONTIME; - static const string EGROUP; - static const string ELIGIBLETIME; - static const string ENDTIME; - static const string EUSER; - static const string EXECUTABLE; - static const string EXECUTIONHOST; - static const string EXITCODE; - static const string HOLD; - static const string ID; - static const string INFILE; - static const string MAIL; - static const string MAXCPUTIME; - static const string MAXDISKSIZE; - static const string MAXRAMSIZE; - static const string MAXWALLTIME; - static const string MODIFICATIONTIME; - static const string NAME; - static const string NBPROC; - static const string OUTFILE; - static const string PID; - static const string QUEUE; - static const string QUEUEDTIME; - static const string SERVER; - static const string STARTTIME; - static const string STATE; - static const string TEXT; - static const string TMPDIR; - static const string USEDCPUTIME; - static const string USEDDISKSIZE; - static const string USEDRAMSIZE; - static const string USEDWALLTIME; - static const string USER; - static const string WORKDIR; - static const string HOMEDIR; + static const std::string ACCOUNT; + static const std::string ARGUMENTS; + static const std::string CHECKPOINT; + static const std::string CKPTINTERVAL; + static const std::string CREATIONTIME; + static const std::string EGROUP; + static const std::string ELIGIBLETIME; + static const std::string ENDTIME; + static const std::string EUSER; + static const std::string EXECUTABLE; + static const std::string EXECUTIONHOST; + static const std::string EXITCODE; + static const std::string HOLD; + static const std::string ID; + static const std::string INFILE; + static const std::string MAIL; + static const std::string MAXCPUTIME; + static const std::string MAXDISKSIZE; + static const std::string MAXRAMSIZE; + static const std::string MAXWALLTIME; + static const std::string MODIFICATIONTIME; + static const std::string NAME; + static const std::string NBPROC; + static const std::string OUTFILE; + static const std::string PID; + static const std::string QUEUE; + static const std::string QUEUEDTIME; + static const std::string SERVER; + static const std::string STARTTIME; + static const std::string STATE; + static const std::string TEXT; + static const std::string TMPDIR; + static const std::string USEDCPUTIME; + static const std::string USEDDISKSIZE; + static const std::string USEDRAMSIZE; + static const std::string USEDWALLTIME; + static const std::string USER; + static const std::string WORKDIR; + static const std::string HOMEDIR; protected: - map< string, TypeParam > TypeMap; // map interne servant a controler le type de la valeur associee a chaque clef + std::map< std::string, TypeParam > TypeMap; // map interne servant a controler le type de la valeur associee a chaque clef private: diff --git a/src/Batch/Batch_PyVersatile.cxx b/src/Batch/Batch_PyVersatile.cxx index f38132ca2..10541cb18 100644 --- a/src/Batch/Batch_PyVersatile.cxx +++ b/src/Batch/Batch_PyVersatile.cxx @@ -34,6 +34,8 @@ #include "Batch_PyVersatile.hxx" #include +using namespace std; + namespace Batch { // Constructeur a partir d'un objet Versatile diff --git a/src/Batch/Batch_PyVersatile.hxx b/src/Batch/Batch_PyVersatile.hxx index 8a26209ad..3bc37f2c5 100644 --- a/src/Batch/Batch_PyVersatile.hxx +++ b/src/Batch/Batch_PyVersatile.hxx @@ -38,7 +38,6 @@ #include "Batch_TypeMismatchException.hxx" #include "Batch_ListIsFullException.hxx" #include "Batch_InvalidArgumentException.hxx" -using namespace std; namespace Batch { diff --git a/src/Batch/Makefile.am b/src/Batch/Makefile.am index bc9ad8367..aaaa33e2b 100644 --- a/src/Batch/Makefile.am +++ b/src/Batch/Makefile.am @@ -117,7 +117,6 @@ LIB_CPPFLAGS = \ ${PYTHON_INCLUDES} \ -I$(srcdir)/../Basics \ -I$(srcdir)/../SALOMELocalTrace \ - -I$(srcdir)/../Utils \ -I$(top_builddir)/salome_adm/unix LIB_LIBADD = \ diff --git a/src/Communication/SALOMEMultiComm.cxx b/src/Communication/SALOMEMultiComm.cxx index 823639296..f268af917 100644 --- a/src/Communication/SALOMEMultiComm.cxx +++ b/src/Communication/SALOMEMultiComm.cxx @@ -18,9 +18,6 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SALOMEMultiComm.hxx" -#ifndef WNT -using namespace std; -#endif SALOMEMultiComm::SALOMEMultiComm():_type(SALOME::CORBA_) { diff --git a/src/Communication/SALOME_Comm_i.cxx b/src/Communication/SALOME_Comm_i.cxx index 02f7e68fd..1aeed449c 100644 --- a/src/Communication/SALOME_Comm_i.cxx +++ b/src/Communication/SALOME_Comm_i.cxx @@ -18,7 +18,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SALOME_Comm_i.hxx" -#ifndef WNT +#ifndef WIN32 #include #endif #include "omniORB4/poa.h" @@ -30,7 +30,7 @@ #include "SenderFactory.hxx" using namespace std; -#ifndef WNT +#ifndef WIN32 CORBA::ORB_var &getGlobalORB(){ ORB_INIT &init = *SINGLETON_::Instance(); CORBA::ORB_var &orb = init(0,0); diff --git a/src/Communication/SALOME_Comm_i.hxx b/src/Communication/SALOME_Comm_i.hxx index 82306c86b..29213d36f 100644 --- a/src/Communication/SALOME_Comm_i.hxx +++ b/src/Communication/SALOME_Comm_i.hxx @@ -130,7 +130,7 @@ public: ~SALOME_CorbaLongCSender_i(); CORBA::ULong getSize(); SALOME::vectorOfLong* sendPart(CORBA::ULong offset, CORBA::ULong length); -#ifndef WNT +#ifndef WIN32 SALOME::CorbaLongCSender_ptr _this(); #endif }; diff --git a/src/Communication/SALOME_Communication.hxx b/src/Communication/SALOME_Communication.hxx index 93c11cc56..bc92ee00c 100755 --- a/src/Communication/SALOME_Communication.hxx +++ b/src/Communication/SALOME_Communication.hxx @@ -26,22 +26,14 @@ #ifndef _SALOME_COMMIUNICATION_HXX_ #define _SALOME_COMMIUNICATION_HXX_ -#ifdef WNT - #if defined COMMUNICATION_EXPORTS - #if defined WIN32 - #define COMMUNICATION_EXPORT __declspec( dllexport ) - #else - #define COMMUNICATION_EXPORT - #endif - #else - #if defined WIN32 - #define COMMUNICATION_EXPORT __declspec( dllimport ) - #else - #define COMMUNICATION_EXPORT - #endif - #endif +#ifdef WIN32 +# ifdef COMMUNICATION_EXPORTS +# define COMMUNICATION_EXPORT __declspec( dllexport ) +# else +# define COMMUNICATION_EXPORT __declspec( dllimport ) +# endif #else - #define COMMUNICATION_EXPORT +# define COMMUNICATION_EXPORT #endif #endif diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index 885750da9..ddfd8631c 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -30,15 +30,15 @@ #include "SALOME_Component_i.hxx" #include "SALOME_Container_i.hxx" #include "RegistryConnexion.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" #include -#ifndef WNT +#ifndef WIN32 #include #endif #include #include "utilities.h" -#ifndef WNT +#ifndef WIN32 #include #include #include @@ -265,7 +265,7 @@ CORBA::Long Engines_Component_i::getStudyId() void Engines_Component_i::ping() { -#ifndef WNT +#ifndef WIN32 MESSAGE("Engines_Component_i::ping() pid "<< getpid() << " threadid " << pthread_self()); #else @@ -385,12 +385,12 @@ bool Engines_Component_i::Kill_impl() // MESSAGE("Engines_Component_i::Kill_i() pthread_t "<< pthread_self() // << " pid " << getpid() << " instanceName " // << _instanceName.c_str() << " interface " << _interfaceName.c_str() -// << " machineName " << GetHostname().c_str()<< " _id " << hex << _id +// << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id // << dec << " _ThreadId " << _ThreadId << " this " << hex << this // << dec ) ; bool RetVal = false ; -#ifndef WNT +#ifndef WIN32 if ( _ThreadId > 0 && pthread_self() != _ThreadId ) { RetVal = Killer( _ThreadId , SIGUSR2 ) ; @@ -416,23 +416,23 @@ bool Engines_Component_i::Kill_impl() bool Engines_Component_i::Stop_impl() { -#ifndef WNT +#ifndef WIN32 MESSAGE("Engines_Component_i::Stop_i() pthread_t "<< pthread_self() << " pid " << getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << GetHostname().c_str()<< " _id " << hex << _id + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id << dec << " _ThreadId " << _ThreadId ); #else MESSAGE("Engines_Component_i::Stop_i() pthread_t "<< pthread_self().p << " pid " << _getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << GetHostname().c_str()<< " _id " << hex << _id + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id << dec << " _ThreadId " << _ThreadId ); #endif bool RetVal = false ; -#ifndef WNT +#ifndef WIN32 if ( _ThreadId > 0 && pthread_self() != _ThreadId ) { RetVal = Killer( _ThreadId , 0 ) ; @@ -456,22 +456,22 @@ bool Engines_Component_i::Stop_impl() bool Engines_Component_i::Suspend_impl() { -#ifndef WNT +#ifndef WIN32 MESSAGE("Engines_Component_i::Suspend_i() pthread_t "<< pthread_self() << " pid " << getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << GetHostname().c_str()<< " _id " << hex << _id + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id << dec << " _ThreadId " << _ThreadId ); #else MESSAGE("Engines_Component_i::Suspend_i() pthread_t "<< pthread_self().p << " pid " << _getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << GetHostname().c_str()<< " _id " << hex << _id + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id << dec << " _ThreadId " << _ThreadId ); #endif bool RetVal = false ; -#ifndef WNT +#ifndef WIN32 if ( _ThreadId > 0 && pthread_self() != _ThreadId ) #else if ( _ThreadId > 0 && pthread_self().p != _ThreadId->p ) @@ -483,7 +483,7 @@ bool Engines_Component_i::Suspend_impl() } else { -#ifndef WNT +#ifndef WIN32 RetVal = Killer( _ThreadId ,SIGINT ) ; #else RetVal = Killer( *_ThreadId ,SIGINT ) ; @@ -503,21 +503,21 @@ bool Engines_Component_i::Suspend_impl() bool Engines_Component_i::Resume_impl() { -#ifndef WNT +#ifndef WIN32 MESSAGE("Engines_Component_i::Resume_i() pthread_t "<< pthread_self() << " pid " << getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << GetHostname().c_str()<< " _id " << hex << _id + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id << dec << " _ThreadId " << _ThreadId ); #else MESSAGE("Engines_Component_i::Resume_i() pthread_t "<< pthread_self().p << " pid " << _getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << GetHostname().c_str()<< " _id " << hex << _id + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id << dec << " _ThreadId " << _ThreadId ); #endif bool RetVal = false ; -#ifndef WNT +#ifndef WIN32 if ( _ThreadId > 0 && pthread_self() != _ThreadId ) #else if ( _ThreadId > 0 && pthread_self().p != _ThreadId->p ) @@ -549,7 +549,7 @@ CORBA::Long Engines_Component_i::CpuUsed_impl() { if ( _ThreadId > 0 ) { -#ifndef WNT +#ifndef WIN32 if ( pthread_self() != _ThreadId ) #else if ( pthread_self().p != _ThreadId->p ) @@ -562,7 +562,7 @@ CORBA::Long Engines_Component_i::CpuUsed_impl() { // Get Cpu in the appropriate thread with that object !... theEngines_Component = this ; -#ifndef WNT +#ifndef WIN32 Killer( _ThreadId ,SIGUSR1 ) ; #else Killer( *_ThreadId ,SIGUSR11 ) ; @@ -651,14 +651,14 @@ PortableServer::ObjectId * Engines_Component_i::getId() void Engines_Component_i::beginService(const char *serviceName) { -#ifndef WNT +#ifndef WIN32 MESSAGE(pthread_self() << "Send BeginService notification for " < #include #include -#ifndef WNT +#ifndef WIN32 #include #include #include @@ -43,12 +43,8 @@ int SIGUSR1 = 1000; #include "utilities.h" #include -//#ifndef WNT #include CORBA_SERVER_HEADER(SALOME_Component) #include CORBA_SERVER_HEADER(SALOME_Exception) -//#else -//#include -//#endif #include // must be before Python.h ! #include "SALOME_Container_i.hxx" #include "SALOME_Component_i.hxx" @@ -56,7 +52,7 @@ int SIGUSR1 = 1000; #include "SALOME_FileTransfer_i.hxx" #include "Salome_file_i.hxx" #include "SALOME_NamingService.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" #include #include "Container_init_python.hxx" @@ -126,8 +122,8 @@ _numInstance(0),_isServantAloneInProcess(isServantAloneInProcess) _argc = argc ; _argv = argv ; - string hostname = GetHostname(); -#ifndef WNT + string hostname = Kernel_Utils::GetHostname(); +#ifndef WIN32 MESSAGE(hostname << " " << getpid() << " Engines_Container_i starting argc " << _argc << " Thread " << pthread_self() ) ; @@ -194,7 +190,7 @@ _numInstance(0),_isServantAloneInProcess(isServantAloneInProcess) if (!_isSupervContainer) { -#ifdef WNT +#ifdef WIN32 PyEval_AcquireLock(); PyThreadState *myTstate = PyThreadState_New(KERNEL_PYTHON::_interp); @@ -203,7 +199,7 @@ _numInstance(0),_isServantAloneInProcess(isServantAloneInProcess) Py_ACQUIRE_NEW_THREAD; #endif -#ifdef WNT +#ifdef WIN32 // mpv: this is temporary solution: there is a unregular crash if not //Sleep(2000); // @@ -285,7 +281,7 @@ void Engines_Container_i::logfilename(const char* name) char* Engines_Container_i::getHostName() { - string s = GetHostname(); + string s = Kernel_Utils::GetHostname(); // MESSAGE("Engines_Container_i::getHostName " << s); return CORBA::string_dup(s.c_str()) ; } @@ -482,7 +478,7 @@ Engines_Container_i::load_component_Library(const char* componentName) // --- try dlopen C++ component -#ifndef WNT +#ifndef WIN32 string impl_name = string ("lib") + aCompName + string("Engine.so"); #else string impl_name = aCompName + string("Engine.dll"); @@ -499,7 +495,7 @@ Engines_Container_i::load_component_Library(const char* componentName) return true; } -#ifndef WNT +#ifndef WIN32 void* handle; handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ; #else @@ -632,7 +628,7 @@ Engines_Container_i::create_component_instance(const char*genericRegisterName, //--- try C++ -#ifndef WNT +#ifndef WIN32 string impl_name = string ("lib") + genericRegisterName +string("Engine.so"); #else string impl_name = genericRegisterName +string("Engine.dll"); @@ -858,7 +854,7 @@ bool Engines_Container_i::Kill_impl() { MESSAGE("Engines_Container_i::Kill() pid "<< getpid() << " containerName " << _containerName.c_str() << " machineName " - << GetHostname().c_str()); + << Kernel_Utils::GetHostname().c_str()); INFOS("==============================================================="); INFOS("= REMOVE calls to Kill_impl in C++ container ="); INFOS("==============================================================="); @@ -1074,7 +1070,7 @@ Engines_Container_i::createInstance(string genericRegisterName, const char *, const char *) ; -#ifndef WNT +#ifndef WIN32 FACTORY_FUNCTION Component_factory = (FACTORY_FUNCTION)dlsym( handle, factory_name.c_str() ); #else FACTORY_FUNCTION Component_factory = (FACTORY_FUNCTION)GetProcAddress( (HINSTANCE)handle, factory_name.c_str() ); @@ -1083,7 +1079,7 @@ Engines_Container_i::createInstance(string genericRegisterName, if ( !Component_factory ) { INFOS( "Can't resolve symbol: " + factory_name ); -#ifndef WNT +#ifndef WIN32 SCRUTE( dlerror() ); #endif return Engines::Component::_nil() ; @@ -1205,7 +1201,7 @@ bool Engines_Container_i::isPythonContainer(const char* ContainerName) void ActSigIntHandler() { -#ifndef WNT +#ifndef WIN32 struct sigaction SigIntAct ; SigIntAct.sa_sigaction = &SigIntHandler ; SigIntAct.sa_flags = SA_SIGINFO ; @@ -1216,7 +1212,7 @@ void ActSigIntHandler() // it must be only one signal ===> one call for SIGINT // and an other one for SIGUSR1 -#ifndef WNT +#ifndef WIN32 if ( sigaction( SIGINT , &SigIntAct, NULL ) ) { perror("SALOME_Container main ") ; @@ -1251,7 +1247,7 @@ void ActSigIntHandler() void SetCpuUsed() ; void CallCancelThread() ; -#ifndef WNT +#ifndef WIN32 void SigIntHandler(int what , siginfo_t * siginfo , void * toto ) @@ -1299,10 +1295,10 @@ void SigIntHandler(int what , return ; } } -#else // Case WNT +#else // Case WIN32 void SigIntHandler( int what ) { -#ifndef WNT +#ifndef WIN32 MESSAGE( pthread_self() << "SigIntHandler what " << what << endl ); #else MESSAGE( "SigIntHandler what " << what << endl ); diff --git a/src/Container/Container_init_python.cxx b/src/Container/Container_init_python.cxx index bea28a668..64979635d 100644 --- a/src/Container/Container_init_python.cxx +++ b/src/Container/Container_init_python.cxx @@ -27,7 +27,7 @@ // $Header$ #include -#ifndef WNT +#ifndef WIN32 #include #endif diff --git a/src/Container/Container_init_python.hxx b/src/Container/Container_init_python.hxx index fd06be3ab..94f5721d4 100644 --- a/src/Container/Container_init_python.hxx +++ b/src/Container/Container_init_python.hxx @@ -59,7 +59,7 @@ struct CONTAINER_EXPORT KERNEL_PYTHON { -#ifdef WNT +#ifdef WIN32 static PyThreadState *get_gtstate() { return KERNEL_PYTHON::_gtstate; } static PyObject *getsalome_shared_modules_module() { return KERNEL_PYTHON::salome_shared_modules_module; } static PyInterpreterState *get_interp() { return KERNEL_PYTHON::_interp; } diff --git a/src/Container/Makefile.am b/src/Container/Makefile.am index 0ad023f7a..16ea20722 100644 --- a/src/Container/Makefile.am +++ b/src/Container/Makefile.am @@ -90,7 +90,7 @@ COMMON_LIBS =\ ../Basics/libSALOMEBasics.la \ ../HDFPersist/libSalomeHDFPersist.la \ ../Batch/libSalomeBatch.la \ - $(top_builddir)/idl/libSalomeIDLKernel.la\ + $(top_builddir)/idl/libSalomeIDLKernel.la \ @MPI_LIBS@ \ @CORBA_LIBS@ \ $(PYTHON_LIBS) @@ -142,6 +142,7 @@ SALOME_Container_CPPFLAGS =\ SALOME_Container_LDADD = \ libSalomeContainer.la \ + ../Basics/libSALOMEBasics.la \ $(HDF5_LIBS) \ $(MPI_LIBS) \ $(CORBA_LIBS) \ @@ -158,6 +159,7 @@ TestSalome_file_CPPFLAGS =\ TestSalome_file_LDADD =\ libSalomeContainer.la \ + ../Basics/libSALOMEBasics.la \ $(HDF5_LIBS) \ $(MPI_LIBS) \ $(CORBA_LIBS) \ diff --git a/src/Container/SALOME_Component_i.hxx b/src/Container/SALOME_Component_i.hxx index c4bfb042c..3d75be638 100644 --- a/src/Container/SALOME_Component_i.hxx +++ b/src/Container/SALOME_Component_i.hxx @@ -36,7 +36,7 @@ #include #include #include -#ifndef WNT +#ifndef WIN32 #include #endif #include @@ -175,7 +175,7 @@ protected: std::string _nodeName ; private: -#ifndef WNT +#ifndef WIN32 pthread_t _ThreadId ; #else pthread_t* _ThreadId ; diff --git a/src/Container/SALOME_Container.cxx b/src/Container/SALOME_Container.cxx index 652728b3e..3cdd20a6a 100644 --- a/src/Container/SALOME_Container.cxx +++ b/src/Container/SALOME_Container.cxx @@ -35,13 +35,13 @@ #include #include #include -#ifndef WNT +#ifndef WIN32 # include # include #endif -#ifndef WNT +#ifndef WIN32 #include #else #include @@ -175,7 +175,7 @@ int main(int argc, char* argv[]) PortableServer::POAManager_var pman = root_poa->the_POAManager(); // add new container to the kill list -#ifndef WNT +#ifndef WIN32 stringstream aCommand ; aCommand << "addToKillList.py " << getpid() << " SALOME_Container" << ends ; system(aCommand.str().c_str()); diff --git a/src/Container/SALOME_Container.hxx b/src/Container/SALOME_Container.hxx index 4d3ff13a0..29f8a9cb8 100755 --- a/src/Container/SALOME_Container.hxx +++ b/src/Container/SALOME_Container.hxx @@ -26,22 +26,14 @@ #ifndef _SALOME_Container_HXX_ #define _SALOME_Container_HXX_ -#ifdef WNT - #if defined CONTAINER_EXPORTS - #if defined WIN32 - #define CONTAINER_EXPORT __declspec( dllexport ) - #else - #define CONTAINER_EXPORT - #endif - #else - #if defined WIN32 - #define CONTAINER_EXPORT __declspec( dllimport ) - #else - #define CONTAINER_EXPORT - #endif - #endif +#ifdef WIN32 +# ifdef CONTAINER_EXPORTS +# define CONTAINER_EXPORT __declspec( dllexport ) +# else +# define CONTAINER_EXPORT __declspec( dllimport ) +# endif #else - #define CONTAINER_EXPORT +# define CONTAINER_EXPORT #endif #endif diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 6264e682b..b98148eca 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -20,10 +20,11 @@ #include "SALOME_ContainerManager.hxx" #include "SALOME_NamingService.hxx" #include "SALOME_ModuleCatalog.hh" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" +#include "Basics_DirUtils.hxx" #include #include -#ifndef WNT +#ifndef WIN32 #include #endif #include @@ -125,13 +126,13 @@ void SALOME_ContainerManager::ShutdownContainers() vector vec = _NS->list_directory_recurs(); list lstCont; for(vector::iterator iter = vec.begin();iter!=vec.end();iter++){ - SCRUTE((*iter)); - CORBA::Object_var obj=_NS->Resolve((*iter).c_str()); - Engines::Container_var cont=Engines::Container::_narrow(obj); - if(!CORBA::is_nil(cont)){ - lstCont.push_back((*iter)); + SCRUTE((*iter)); + CORBA::Object_var obj=_NS->Resolve((*iter).c_str()); + Engines::Container_var cont=Engines::Container::_narrow(obj); + if(!CORBA::is_nil(cont)){ + lstCont.push_back((*iter)); + } } - } MESSAGE("Container list: "); for(list::iterator iter=lstCont.begin();iter!=lstCont.end();iter++){ SCRUTE((*iter)); @@ -240,7 +241,7 @@ StartContainer(const Engines::MachineParameters& params, //If the machine name is localhost use the real name if(theMachine == "localhost") - theMachine=GetHostname(); + theMachine=Kernel_Utils::GetHostname(); MESSAGE("try to launch it on " << theMachine); @@ -259,12 +260,12 @@ StartContainer(const Engines::MachineParameters& params, "no possible computer"); return Engines::Container::_nil(); } - else if(theMachine==GetHostname()) + else if(theMachine==Kernel_Utils::GetHostname()) command = BuildCommandToLaunchLocalContainer(params,id,container_exe); else command = BuildCommandToLaunchRemoteContainer(theMachine,params,id,container_exe); - RmTmpFile(); + // RmTmpFile(); Too early! May be this function has not been used for a long time... //check if an entry exists in Naming service if(params.isMPI) @@ -280,19 +281,19 @@ StartContainer(const Engines::MachineParameters& params, CORBA::Object_var obj = _NS->Resolve(containerNameInNS.c_str()); if ( !CORBA::is_nil(obj) ) { - // shutdown the registered container if it exists - Engines::Container_var cont=Engines::Container::_narrow(obj); - if(!CORBA::is_nil(cont)) - { - try - { - cont->Shutdown(); - } - catch(CORBA::Exception&) + // shutdown the registered container if it exists + Engines::Container_var cont=Engines::Container::_narrow(obj); + if(!CORBA::is_nil(cont)) + { + try + { + cont->Shutdown(); + } + catch(CORBA::Exception&) { - INFOS("CORBA::Exception ignored."); - } - } + INFOS("CORBA::Exception ignored."); + } + } } //redirect stdout and stderr in a file @@ -301,6 +302,9 @@ StartContainer(const Engines::MachineParameters& params, // launch container with a system call int status=system(command.c_str()); + + RmTmpFile(); // command file can be removed here + if (status == -1){ MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed " << "(system command status -1)"); @@ -315,7 +319,7 @@ StartContainer(const Engines::MachineParameters& params, int count=TIME_OUT_TO_LAUNCH_CONT; MESSAGE("count = "<logfilename(logFilename.c_str()); } @@ -448,7 +452,7 @@ FindOrStartParallelContainer(const Engines::MachineParameters& params_const, else { INFOS("[FindOrStartParallelContainer] on machine : " << theMachine); string command; - if(theMachine == GetHostname()) { + if(theMachine == Kernel_Utils::GetHostname()) { // Step 3 : starting parallel container proxy params.hostname = CORBA::string_dup(theMachine.c_str()); Engines::MachineParameters params_proxy(params); @@ -474,7 +478,7 @@ FindOrStartParallelContainer(const Engines::MachineParameters& params_const, for (int i = 0; i < params.nb_component_nodes; i++) { char buffer [5]; -#ifndef WNT +#ifndef WIN32 snprintf(buffer,5,"%d",i); #else _snprintf(buffer,5,"%d",i); @@ -487,7 +491,7 @@ FindOrStartParallelContainer(const Engines::MachineParameters& params_const, obj = _NS->Resolve(containerNameInNS.c_str()); while (CORBA::is_nil(obj) && count) { INFOS("[FindOrStartParallelContainer] CONNECTION FAILED !!!!!!!!!!!!!!!!!!!!!!!!"); -#ifndef WNT +#ifndef WIN32 sleep(1) ; #else Sleep(1000); @@ -662,7 +666,7 @@ SALOME_ContainerManager::LaunchParallelContainer(const std::string& command, INFOS("[LaunchParallelContainer] Waiting for Parallel Container proxy on " << theMachine); while (CORBA::is_nil(obj) && count) { -#ifndef WNT +#ifndef WIN32 sleep(1) ; #else Sleep(1000); @@ -687,7 +691,7 @@ SALOME_ContainerManager::LaunchParallelContainer(const std::string& command, // Name of the node char buffer [5]; -#ifndef WNT +#ifndef WIN32 snprintf(buffer,5,"%d",i); #else _snprintf(buffer,5,"%d",i); @@ -700,7 +704,7 @@ SALOME_ContainerManager::LaunchParallelContainer(const std::string& command, containerNameInNS = _NS->BuildContainerNameForNS((char*) name_cont.c_str(),theMachine.c_str()); cerr << "[LaunchContainer] Waiting for Parllel Container node " << containerNameInNS << " on " << theMachine << endl; while (CORBA::is_nil(obj) && count) { -#ifndef WNT +#ifndef WIN32 sleep(1) ; #else Sleep(1000); @@ -953,7 +957,7 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalContainer if(wdir == "$TEMPDIR") { // a new temporary directory is requested - string dir = OpUtil_Dir::GetTmpDir(); + string dir = Kernel_Utils::GetTmpDir(); #ifdef WIN32 //command += "cd /d "+ dir +";"; command_file << "cd /d " << dir << endl; @@ -1016,20 +1020,31 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalContainer void SALOME_ContainerManager::RmTmpFile() { - if (_TmpFileName != "") + int lenght = _TmpFileName.size(); + if ( lenght > 0) { -#ifndef WNT - string command = "rm "; -#else +#ifdef WIN32 string command = "del /F "; +#else + string command = "rm "; #endif - command += _TmpFileName; - char *temp = strdup(command.c_str()); - int lgthTemp = strlen(temp); - temp[lgthTemp - 3] = '*'; - temp[lgthTemp - 2] = '\0'; - system(temp); - free(temp); + if ( lenght > 4 ) + command += _TmpFileName.substr(0, lenght - 3 ); + else + command += _TmpFileName; + command += '*'; + system(command.c_str()); + //if dir is empty - remove it + string tmp_dir = Kernel_Utils::GetDirByPath( _TmpFileName ); + if ( Kernel_Utils::IsEmptyDir( tmp_dir ) ) + { +#ifdef WIN32 + command = "del /F " + tmp_dir; +#else + command = "rmdir " + tmp_dir; +#endif + system(command.c_str()); + } } } @@ -1069,7 +1084,7 @@ void SALOME_ContainerManager::AddOmninamesParams(ofstream& fileStream) const string SALOME_ContainerManager::BuildTemporaryFileName() const { //build more complex file name to support multiple salome session - string aFileName = OpUtil_Dir::GetTmpFileName(); + string aFileName = Kernel_Utils::GetTmpFileName(); #ifndef WIN32 aFileName += ".sh"; #else @@ -1297,7 +1312,7 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalParallelContainer(const std::s command += " > /tmp/"; command += _NS->ContainerName(rtn); command += "_"; - command += GetHostname(); + command += Kernel_Utils::GetHostname(); command += "_"; command += getenv( "USER" ) ; command += ".log 2>&1 &" ; diff --git a/src/Container/SALOME_Container_i.hxx b/src/Container/SALOME_Container_i.hxx index f9aef6033..c1a4de884 100644 --- a/src/Container/SALOME_Container_i.hxx +++ b/src/Container/SALOME_Container_i.hxx @@ -37,7 +37,7 @@ #include #include #include -#ifndef WNT +#ifndef WIN32 #include #endif #include diff --git a/src/Container/SALOME_FileRef_i.cxx b/src/Container/SALOME_FileRef_i.cxx index 3fda8667f..b644795fb 100644 --- a/src/Container/SALOME_FileRef_i.cxx +++ b/src/Container/SALOME_FileRef_i.cxx @@ -25,7 +25,7 @@ #include "SALOME_FileRef_i.hxx" #include "utilities.h" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" #include using namespace std; @@ -52,7 +52,7 @@ fileRef_i::fileRef_i(Engines::Container_ptr container, MESSAGE("fileRef_i::fileRef_i "<< origFileName); _container = Engines::Container::_duplicate(container); _origFileName = origFileName; - _machine = GetHostname(); + _machine = Kernel_Utils::GetHostname(); #if defined(_DEBUG_) || defined(_DEBUG) int OK = addRef(_machine.c_str(), _origFileName.c_str()); SCRUTE(OK); diff --git a/src/Container/Salome_file_i.cxx b/src/Container/Salome_file_i.cxx index ed49325f9..962a9ad81 100644 --- a/src/Container/Salome_file_i.cxx +++ b/src/Container/Salome_file_i.cxx @@ -27,7 +27,7 @@ #include "utilities.h" #include #include "HDFOI.hxx" -#ifndef WNT +#ifndef WIN32 # include # define _getcwd getcwd # define _open open diff --git a/src/DF/DF_definitions.hxx b/src/DF/DF_definitions.hxx index 3cfe5585d..a9dd7eaa4 100644 --- a/src/DF/DF_definitions.hxx +++ b/src/DF/DF_definitions.hxx @@ -68,7 +68,7 @@ public: }; -# if defined(WNT) && !defined(HAVE_NO_DLL) +# if defined(WIN32) && !defined(HAVE_NO_DLL) # ifndef Standard_EXPORT # define Standard_EXPORT __declspec( dllexport ) @@ -82,7 +82,7 @@ public: # define Standard_IMPORTC extern "C" __declspec( dllimport ) # endif /* Standard_IMPORT */ -# else /* WNT */ +# else /* WIN32 */ # ifndef Standard_EXPORT # define Standard_EXPORT @@ -96,11 +96,11 @@ public: # define Standard_IMPORTC extern "C" # endif /* Standard_IMPORT */ -# endif /* WNT */ +# endif /* WIN32 */ # ifndef __Standard_API -//# ifdef WNT -# if !defined(WNT) +//# ifdef WIN32 +# if !defined(WIN32) # define __Standard_API Standard_EXPORT # define __Standard_APIEXTERN Standard_EXPORTEXTERN # else @@ -109,7 +109,7 @@ public: # endif // __Standard_DLL //# else //# define __Standard_API -//# endif // WNT +//# endif // WIN32 # endif // __Standard_API #include diff --git a/src/DF/testDF.cxx b/src/DF/testDF.cxx index ee457316f..b6148e4b9 100644 --- a/src/DF/testDF.cxx +++ b/src/DF/testDF.cxx @@ -33,7 +33,7 @@ #include "DF_Container.hxx" #include "DF_ChildIterator.hxx" -#ifndef WNT +#ifndef WIN32 #include #include #include @@ -52,7 +52,7 @@ void printStr(const string& theValue) void GetSystemDate(int& year, int& month, int& day, int& hours, int& minutes, int& seconds) { -#ifdef WNT +#ifdef WIN32 SYSTEMTIME st; GetLocalTime ( &st ); @@ -83,7 +83,7 @@ void GetSystemDate(int& year, int& month, int& day, int& hours, int& minutes, in string GetUserName() { -#ifdef WNT +#ifdef WIN32 char* pBuff = new char[UNLEN + 1]; DWORD dwSize = UNLEN + 1; string retVal; @@ -128,7 +128,7 @@ string GetDirFromPath(const string& thePath) { path = thePath+"/"; } -#ifdef WNT //Check if the only disk letter is given as path +#ifdef WIN32 //Check if the only disk letter is given as path if(path.size() == 2 && path[1] == ":") path +='\\'; #endif @@ -140,7 +140,7 @@ string GetDirFromPath(const string& thePath) { bool Exists(const string thePath) { -#ifdef WNT +#ifdef WIN32 if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { if ( GetLastError () != ERROR_FILE_NOT_FOUND ) { return false; diff --git a/src/DSC/DSC_Basic/DSC_Basic.hxx b/src/DSC/DSC_Basic/DSC_Basic.hxx index 0efc1a2e2..b06f5d075 100755 --- a/src/DSC/DSC_Basic/DSC_Basic.hxx +++ b/src/DSC/DSC_Basic/DSC_Basic.hxx @@ -26,22 +26,14 @@ #ifndef _DSC_Basic_HXX_ #define _DSC_Basic_HXX_ -#ifdef WNT - #if defined DSC_BASIC_EXPORTS - #if defined WIN32 - #define DSC_BASIC_EXPORT __declspec( dllexport ) - #else - #define DSC_BASIC_EXPORT - #endif - #else - #if defined WIN32 - #define DSC_BASIC_EXPORT __declspec( dllimport ) - #else - #define DSC_BASIC_EXPORT - #endif - #endif +#ifdef WIN32 +# ifdef DSC_BASIC_EXPORTS +# define DSC_BASIC_EXPORT __declspec( dllexport ) +# else +# define DSC_BASIC_EXPORT __declspec( dllimport ) +# endif #else - #define DSC_BASIC_EXPORT +# define DSC_BASIC_EXPORT #endif #endif diff --git a/src/DSC/DSC_User/Basic/basic_port_factory.cxx b/src/DSC/DSC_User/Basic/basic_port_factory.cxx index 4d7d4a75d..e0d8333a2 100644 --- a/src/DSC/DSC_User/Basic/basic_port_factory.cxx +++ b/src/DSC/DSC_User/Basic/basic_port_factory.cxx @@ -25,6 +25,8 @@ #include "basic_port_factory.hxx" +using namespace std; + basic_port_factory::basic_port_factory() {} basic_port_factory::~basic_port_factory() {} diff --git a/src/DSC/DSC_User/Basic/basic_port_factory.hxx b/src/DSC/DSC_User/Basic/basic_port_factory.hxx index 8407c217b..42a698def 100644 --- a/src/DSC/DSC_User/Basic/basic_port_factory.hxx +++ b/src/DSC/DSC_User/Basic/basic_port_factory.hxx @@ -30,8 +30,6 @@ #include "data_short_port_provides.hxx" #include "data_short_port_uses.hxx" -using namespace std; - /*! \class basic_port_factory * \brief This class is an example of factory for DSC_User ports. * @@ -52,7 +50,7 @@ class basic_port_factory : * \param type the basic port's type. * \return a pointer of the provides port. */ - virtual provides_port * create_data_servant(string type); + virtual provides_port * create_data_servant(std::string type); /*! * This method creates a uses port of Basic ports. @@ -60,7 +58,7 @@ class basic_port_factory : * \param type the basic port's type. * \return a pointer of the uses port. */ - virtual uses_port * create_data_proxy(string type); + virtual uses_port * create_data_proxy(std::string type); }; #endif diff --git a/src/DSC/DSC_User/DSC_Exception.hxx b/src/DSC/DSC_User/DSC_Exception.hxx index 46bd5ab03..2d72aa354 100644 --- a/src/DSC/DSC_User/DSC_Exception.hxx +++ b/src/DSC/DSC_User/DSC_Exception.hxx @@ -34,17 +34,17 @@ #include "utilities.h" -#ifndef WNT +#ifndef WIN32 extern "C" { #endif #include -#ifndef WNT +#ifndef WIN32 } #endif -#ifdef _DEBUG_ +#if defined(_DEBUG_) || defined(_DEBUG) # ifdef __GNUC__ # define LOC(message) (message), __FILE__ , __LINE__ , __FUNCTION__ # else diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx index 969b510e8..573f2ea5b 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx @@ -163,7 +163,7 @@ namespace CalciumInterface { double & ti, double const & tf, long & i, - const string & nomVar, + const std::string & nomVar, size_t bufferLength, size_t & nRead, T1 * &data ) @@ -321,14 +321,14 @@ namespace CalciumInterface { // T1 est le type de données template static void ecp_lecture ( Superv_Component_i & component, - int const & dependencyType, - double & ti, - double const & tf, - long & i, - const string & nomVar, - size_t bufferLength, - size_t & nRead, - T1 * &data ) + int const & dependencyType, + double & ti, + double const & tf, + long & i, + const std::string & nomVar, + size_t bufferLength, + size_t & nRead, + T1 * &data ) { ecp_lecture (component,dependencyType,ti,tf, i,nomVar,bufferLength,nRead,data); @@ -341,12 +341,12 @@ namespace CalciumInterface { // T2 : PortType template static void ecp_ecriture ( Superv_Component_i & component, - int const & dependencyType, - double const & t, - long const & i, - const string & nomVar, - size_t bufferLength, - T1 const & data ) + int const & dependencyType, + double const & t, + long const & i, + const std::string & nomVar, + size_t bufferLength, + T1 const & data ) { assert(&component); @@ -502,7 +502,7 @@ namespace CalciumInterface { #ifdef _DEBUG_ std::cout << "-------- CalciumInterface(ecriture), Valeur de corbaData : " << std::endl; for (int i = 0; i < corbaData->length(); ++i) - cout << "-------- CalciumInterface(ecriture), corbaData[" << i << "] = " << (*corbaData)[i] << endl; + std::cout << "-------- CalciumInterface(ecriture), corbaData[" << i << "] = " << (*corbaData)[i] << std::endl; #endif // if ( !IsSameType::value ) delete corbaData; @@ -521,7 +521,7 @@ namespace CalciumInterface { int const & dependencyType, double const & t, long const & i, - const string & nomVar, + const std::string & nomVar, size_t bufferLength, T1 const & data ) { ecp_ecriture (component,dependencyType,t,i,nomVar,bufferLength,data); diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.cxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.cxx index 504945a57..121ede25d 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.cxx @@ -28,6 +28,8 @@ #include "calcium_port_factory.hxx" +using namespace std; + calcium_port_factory::calcium_port_factory() {} calcium_port_factory::~calcium_port_factory() {} diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.hxx index 6cb050411..03e317a99 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.hxx @@ -44,8 +44,6 @@ #include "calcium_logical_port_uses.hxx" #include "calcium_complex_port_uses.hxx" -using namespace std; - class calcium_port_factory : public port_factory { @@ -53,8 +51,8 @@ class calcium_port_factory : calcium_port_factory(); virtual ~calcium_port_factory(); - virtual provides_port * create_data_servant(string type); - virtual uses_port * create_data_proxy(string type); + virtual provides_port * create_data_servant(std::string type); + virtual uses_port * create_data_proxy(std::string type); }; #endif diff --git a/src/DSC/DSC_User/Datastream/DataIdFilter.hxx b/src/DSC/DSC_User/Datastream/DataIdFilter.hxx index 91853d713..a59728523 100644 --- a/src/DSC/DSC_User/Datastream/DataIdFilter.hxx +++ b/src/DSC/DSC_User/Datastream/DataIdFilter.hxx @@ -82,8 +82,6 @@ #include // Pour l'utilisation de "vector" de la STL -using namespace std; - // Classe filtre_elementaire // // Implémente une structure de donnée décrivant un filtre élémentaire @@ -177,7 +175,7 @@ private: // Données de configuration de filtrage et conversion: // une table de filtres élémentaires // avec leurs données de conversion associées éventuelles - vector config; + std::vector config; public: // Constructeur: juste une allocation mémoire initiale @@ -187,7 +185,7 @@ public: // réclamer la mémoire utilisée par tous les éléments du vecteur config ~filtre_conversion() { - vector::iterator i; + std::vector::iterator i; for (i = this->config.begin(); i != this->config.end(); i ++) { delete (*i).p_convers; @@ -254,7 +252,7 @@ public: } // applique_filtre_conversion: Opération du filtre et de la conversion - template T applique_filtre_conversion (T valeur_initiale, vector& liste_conversions) const; + template T applique_filtre_conversion (T valeur_initiale, std::vector& liste_conversions) const; }; @@ -278,7 +276,7 @@ public: // si cette longueur est 0, c'est que la valeur initiale ne passe pas le filtre // template -T filtre_conversion::applique_filtre_conversion (T valeur_initiale, vector& liste_conversions) const +T filtre_conversion::applique_filtre_conversion (T valeur_initiale, std::vector& liste_conversions) const { // Part d'une liste vierge liste_conversions.clear(); @@ -289,7 +287,7 @@ T filtre_conversion::applique_filtre_conversion (T valeur_initiale, vector& l // et cherche pour chacun d'eux si la valeur initiale est présente parmi les valeurs filtrées // Pour tous les éléments de configuration du filtrage/conversion - vector::const_iterator i; + std::vector::const_iterator i; for (i = config.begin(); i != config.end(); i ++) { diff --git a/src/DSC/DSC_User/Datastream/Palm/PalmCouplingPolicy.hxx b/src/DSC/DSC_User/Datastream/Palm/PalmCouplingPolicy.hxx index c5f57fff4..ac23a59ce 100644 --- a/src/DSC/DSC_User/Datastream/Palm/PalmCouplingPolicy.hxx +++ b/src/DSC/DSC_User/Datastream/Palm/PalmCouplingPolicy.hxx @@ -87,11 +87,11 @@ public: std::cout << "----Cst ---- InternalDataIdContainer(const DataId & dataId..) " << dataId <::iterator i=_lTime.begin();i!=_lTime.end();++i) + for(std::vector::iterator i=_lTime.begin();i!=_lTime.end();++i) std::cout << "_lTime["<< c++ << "] : " << *i << std::endl; policy.filtre_convert_TAG.applique_filtre_conversion(dataId.second, _lTag); c=0; - for(vector::iterator i=_lTag.begin();i!=_lTag.end();++i) + for(std::vector::iterator i=_lTag.begin();i!=_lTag.end();++i) std::cout << "_lTag["<< c++ << "] : " << *i << std::endl; } diff --git a/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx b/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx index 2c194efb1..43107b133 100644 --- a/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx +++ b/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx @@ -29,6 +29,8 @@ #include "palm_port_factory.hxx" +using namespace std; + palm_port_factory::palm_port_factory() { } diff --git a/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.hxx b/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.hxx index 544a9c1eb..c8007374b 100644 --- a/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.hxx +++ b/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.hxx @@ -38,8 +38,6 @@ #include "palm_data_short_port_provides.hxx" #include "palm_data_seq_short_port_provides.hxx" -using namespace std; - class palm_port_factory : public port_factory { @@ -47,8 +45,8 @@ class palm_port_factory : palm_port_factory(); virtual ~palm_port_factory(); - virtual provides_port * create_data_servant(string type); - virtual uses_port * create_data_proxy(string type); + virtual provides_port * create_data_servant(std::string type); + virtual uses_port * create_data_proxy(std::string type); }; #endif diff --git a/src/DSC/DSC_User/Superv_Component_i.cxx b/src/DSC/DSC_User/Superv_Component_i.cxx index 4a6449990..941a3e12a 100644 --- a/src/DSC/DSC_User/Superv_Component_i.cxx +++ b/src/DSC/DSC_User/Superv_Component_i.cxx @@ -25,6 +25,8 @@ #include "Superv_Component_i.hxx" +using namespace std; + DSC_EXCEPTION_CXX(Superv_Component_i,BadFabType); DSC_EXCEPTION_CXX(Superv_Component_i,BadType); DSC_EXCEPTION_CXX(Superv_Component_i,BadCast); diff --git a/src/DSC/DSC_User/Superv_Component_i.hxx b/src/DSC/DSC_User/Superv_Component_i.hxx index 2c8467e05..8a106efc4 100644 --- a/src/DSC/DSC_User/Superv_Component_i.hxx +++ b/src/DSC/DSC_User/Superv_Component_i.hxx @@ -39,9 +39,6 @@ #include "DSC_Exception.hxx" - -using namespace std; - /*! \class Superv_Component_i * \brief This class implements DSC_User component. * diff --git a/src/GenericObj/SALOME_GenericObj_i.cc b/src/GenericObj/SALOME_GenericObj_i.cc index 2760b73db..9158f4ed9 100644 --- a/src/GenericObj/SALOME_GenericObj_i.cc +++ b/src/GenericObj/SALOME_GenericObj_i.cc @@ -41,7 +41,7 @@ GenericObj_i::GenericObj_i(PortableServer::POA_ptr thePOA): myRefCounter(1){ MESSAGE("GenericObj_i::GenericObj_i() - this = "< #include -#ifdef WNT +#ifdef WIN32 #include #include #include @@ -697,7 +697,7 @@ string GetTmpDir() aDir = aTmpDir+buffer; //Build a unique directory name } -#ifdef WNT +#ifdef WIN32 //fuction CreateDirectory create only final directory, but not intermediate CreateDirectory(aTmpDir.c_str(), NULL); CreateDirectory(aDir.c_str(), NULL); @@ -763,7 +763,7 @@ void read_float64(FILE* fp, hdf_float64* value) bool Exists(const string thePath) { -#ifdef WNT +#ifdef WIN32 if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { if ( GetLastError () != ERROR_FILE_NOT_FOUND ) { return false; @@ -778,7 +778,7 @@ bool Exists(const string thePath) void Move(const string& fName, const string& fNameDst) { -#ifdef WNT +#ifdef WIN32 MoveFileEx (fName.c_str(), fNameDst.c_str(),MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED); #else rename(fName.c_str(), fNameDst.c_str()); diff --git a/src/HDFPersist/HDFconvert.cc b/src/HDFPersist/HDFconvert.cc index eaf7b21a5..6bac949e0 100644 --- a/src/HDFPersist/HDFconvert.cc +++ b/src/HDFPersist/HDFconvert.cc @@ -27,7 +27,7 @@ #include "HDFconvert.hxx" using namespace std; -#ifdef WNT +#ifdef WIN32 #include #include #endif @@ -64,7 +64,7 @@ int HDFConvert::FromAscii(const string& file, const HDFcontainerObject & hdf_con perror("HDFConvert::FromAscii"); return -1; }; -#elif defined WNT +#elif defined WIN32 #define SHMEMSIZE 4096 diff --git a/src/HDFPersist/HDFconvert.hxx b/src/HDFPersist/HDFconvert.hxx index e4fae3a06..876340d44 100644 --- a/src/HDFPersist/HDFconvert.hxx +++ b/src/HDFPersist/HDFconvert.hxx @@ -30,7 +30,7 @@ extern "C" { #include "HDFtypes.h" -#ifndef WNT +#ifndef WIN32 #include #include #else diff --git a/src/HDFPersist/HDFfile.cc b/src/HDFPersist/HDFfile.cc index 96c763598..aea67a55a 100644 --- a/src/HDFPersist/HDFfile.cc +++ b/src/HDFPersist/HDFfile.cc @@ -27,7 +27,7 @@ extern "C" { #include "hdfi.h" -#ifndef WNT +#ifndef WIN32 #include #else #include diff --git a/src/HDFPersist/HDFinternalObject.cc b/src/HDFPersist/HDFinternalObject.cc index 716e6da49..7a5fb6f0e 100644 --- a/src/HDFPersist/HDFinternalObject.cc +++ b/src/HDFPersist/HDFinternalObject.cc @@ -29,9 +29,6 @@ extern "C" #include "hdfi.h" } #include "HDFinternalObject.hxx" -#ifndef WNT -using namespace std; -#endif HDFinternalObject::HDFinternalObject(const char *name) : HDFobject(name) diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index 589ec566f..ed4641f00 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -29,6 +29,10 @@ #include #include +#ifdef WIN32 +# include +#endif + using namespace std; //============================================================================= diff --git a/src/Launcher/Makefile.am b/src/Launcher/Makefile.am index 8a7a6ff4a..9211ed82d 100644 --- a/src/Launcher/Makefile.am +++ b/src/Launcher/Makefile.am @@ -140,6 +140,7 @@ SALOME_LauncherServer_CPPFLAGS=\ SALOME_LauncherServer_LDADD =\ libSalomeLauncher.la \ + ../Basics/libSALOMEBasics.la \ $(MPI_LIBS) \ $(CORBA_LIBS) \ $(LIBXML_LIBS) \ diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx index 4ce5d8b97..f2edfe0fb 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx @@ -26,7 +26,7 @@ #include "SALOME_FileTransferCORBA.hxx" #include "SALOME_LifeCycleCORBA.hxx" #include "utilities.h" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" using namespace std; @@ -146,7 +146,7 @@ string SALOME_FileTransferCORBA::getLocalFile(string localFile) container = _theFileRef->getContainer(); ASSERT(! CORBA::is_nil(container)); - string myMachine = GetHostname(); + string myMachine = Kernel_Utils::GetHostname(); string localCopy = _theFileRef->getRef(myMachine.c_str()); if (localCopy.empty()) // no existing copy available diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx index c0927d92c..4ac4576c8 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx @@ -34,7 +34,7 @@ #include -#ifdef WNT +#ifdef WIN32 # if defined LIFECYCLECORBA_EXPORTS # define LIFECYCLECORBA_EXPORT __declspec( dllexport ) # else diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 9b399893d..ef14d7cc9 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -32,29 +32,22 @@ #include #include -#ifndef WNT +#ifndef WIN32 #include #endif -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" #include "utilities.h" #include #include "SALOME_LifeCycleCORBA.hxx" -#ifndef WNT #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) #include CORBA_CLIENT_HEADER(SALOME_Session) #include CORBA_CLIENT_HEADER(DSC_Engines) #include CORBA_CLIENT_HEADER(SALOME_Registry) #include CORBA_CLIENT_HEADER(SALOMEDS) -#else -#include "SALOME_ModuleCatalog.hh" -#include "SALOME_Session.hh" -#include "DSC_Engines.hh" -#include "SALOME_Registry.hh" -#include "SALOMEDS.hh" -#endif + #include "SALOME_ContainerManager.hxx" #include "SALOME_Component_i.hxx" #include "SALOME_NamingService.hxx" @@ -276,7 +269,7 @@ SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName, { // containerName doesn't contain "/" => Local container params->container_name=CORBA::string_dup(stContainer); - params->hostname=CORBA::string_dup(GetHostname().c_str()); + params->hostname=CORBA::string_dup(Kernel_Utils::GetHostname().c_str()); } else { @@ -453,7 +446,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() } } - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); // 1) SalomeLauncher CORBA::Object_var objSL = _NS->Resolve("/SalomeLauncher"); diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx index 42e67688d..65ec4e026 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx @@ -30,7 +30,7 @@ #define _SALOME_LIFECYCLECORBA_HXX_ #include -#ifndef WNT +#ifndef WIN32 #include #endif #include @@ -40,8 +40,8 @@ #include CORBA_CLIENT_HEADER(SALOME_ContainerManager) #include CORBA_CLIENT_HEADER(SALOME_Component) #include -using namespace std; -#ifdef WNT + +#ifdef WIN32 # if defined LIFECYCLECORBA_EXPORTS # define LIFECYCLECORBA_EXPORT __declspec( dllexport ) # else diff --git a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx index 7a047fd38..1fc751484 100644 --- a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx +++ b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx @@ -23,7 +23,7 @@ #include "SALOME_FileTransferCORBA.hxx" #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" #include #include @@ -294,7 +294,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_LaunchContainerHostname() // --- get a local container (with a name based on local hostname), // load an engine, check that the CORBA object is not null - string containerName = GetHostname(); + string containerName = Kernel_Utils::GetHostname(); containerName += "/theContainer"; DEVTRACE("containerName = " << containerName); Engines::Component_var mycompo = @@ -329,7 +329,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_SameContainer() _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent"); CPPUNIT_ASSERT(!CORBA::is_nil(mycompo1)); - containerName = GetHostname(); + containerName = Kernel_Utils::GetHostname(); containerName += "/aContainer"; DEVTRACE("containerName = " << containerName); Engines::Component_var mycompo2 = @@ -441,7 +441,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsLocalContainer() Engines::MachineParameters params; _LCC.preSet(params); - string hostname=GetHostname(); + string hostname=Kernel_Utils::GetHostname(); params.hostname=hostname.c_str(); Engines::Component_var mycompo = _LCC.FindOrLoad_Component(params,"SalomeTestComponent"); @@ -458,7 +458,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsLocalContainer() Engines::Container_var c1 = m1->GetContainerRef(); CPPUNIT_ASSERT(!CORBA::is_nil(c1)); string hostname1 = c1->getHostName(); - CPPUNIT_ASSERT_EQUAL(hostname1, GetHostname()); + CPPUNIT_ASSERT_EQUAL(hostname1, Kernel_Utils::GetHostname()); } @@ -492,7 +492,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsContainerName() Engines::Container_var c1 = m1->GetContainerRef(); CPPUNIT_ASSERT(!CORBA::is_nil(c1)); string hostname1 = c1->getHostName(); - CPPUNIT_ASSERT_EQUAL(hostname1, GetHostname()); + CPPUNIT_ASSERT_EQUAL(hostname1, Kernel_Utils::GetHostname()); string cname1 = c1->name(); CPPUNIT_ASSERT(cname1.find(containerName) != string::npos); } @@ -621,7 +621,7 @@ void LifeCycleCORBATest::testgetLocalFile_localComputer() SALOME_LifeCycleCORBA _LCC(&_NS); string origFileName = getenv("KERNEL_ROOT_DIR"); origFileName += "/lib/salome/libSalomeLifeCycleCORBA.so.0.0.0"; - SALOME_FileTransferCORBA transfer( GetHostname(), + SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(), origFileName); string local = transfer.getLocalFile(); CPPUNIT_ASSERT(!local.empty()); @@ -688,7 +688,7 @@ string LifeCycleCORBATest::GetRemoteHost() resourcesManager->GetFittingResources(params,clist); CPPUNIT_ASSERT(hostList->length() > 1); - string localHost = GetHostname(); + string localHost = Kernel_Utils::GetHostname(); string remoteHost; for (unsigned int i=0; i < hostList->length(); i++) { diff --git a/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx index 2cd147634..eaf0ba7d8 100644 --- a/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx @@ -27,22 +27,17 @@ // $Header$ #include -#ifndef WNT +#ifndef WIN32 #include #endif #include -#ifndef WNT #include CORBA_CLIENT_HEADER(SALOME_Component) #include CORBA_CLIENT_HEADER(SALOME_TestComponent) -#else -#include -#include -#endif #include "SALOME_NamingService.hxx" #include "SALOME_LifeCycleCORBA.hxx" #include "SALOME_FileTransferCORBA.hxx" #include "utilities.h" -#include +#include using namespace std; @@ -108,7 +103,7 @@ int main (int argc, char * argv[]) // --- yet another container, with hostname, // load an engine, and invoque methods on that engine - string containerName4 = GetHostname(); + string containerName4 = Kernel_Utils::GetHostname(); containerName4 += "/titiPy"; Engines::Component_var mycompo4 = _LCC.FindOrLoad_Component(containerName4.c_str(),"SALOME_TestComponentPy"); @@ -120,7 +115,7 @@ int main (int argc, char * argv[]) // --- try a local file transfer string origFileName = "/home/prascle/petitfichier"; - SALOME_FileTransferCORBA transfer( GetHostname(), + SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(), origFileName); string local = transfer.getLocalFile(); SCRUTE(local); diff --git a/src/Logger/SALOME_Logger_Server.cxx b/src/Logger/SALOME_Logger_Server.cxx index 88d33c576..af0bd305d 100644 --- a/src/Logger/SALOME_Logger_Server.cxx +++ b/src/Logger/SALOME_Logger_Server.cxx @@ -16,7 +16,7 @@ # include #endif -#ifdef WNT +#ifdef WIN32 #include #endif diff --git a/src/Logger/SALOME_Logger_Server.hxx b/src/Logger/SALOME_Logger_Server.hxx index 6481eb995..b8450773e 100644 --- a/src/Logger/SALOME_Logger_Server.hxx +++ b/src/Logger/SALOME_Logger_Server.hxx @@ -13,7 +13,7 @@ #include -#ifndef WNT +#ifndef WIN32 #include #else #include @@ -22,7 +22,7 @@ #include #include "Logger.hh" -#ifdef WNT +#ifdef WIN32 # if defined LOGGER_EXPORTS # define LOGGER_EXPORT __declspec( dllexport ) # else @@ -52,7 +52,7 @@ private: //otherwise all messages will be put into terminal via cout bool m_putIntoFile; //ofstream class specialized for disk file output -#ifndef WNT +#ifndef WIN32 ofstream m_outputFile; #else std::ofstream m_outputFile; diff --git a/src/Logger/SALOME_Logger_Server_main.cxx b/src/Logger/SALOME_Logger_Server_main.cxx index c9551d567..ba0ed2ee5 100644 --- a/src/Logger/SALOME_Logger_Server_main.cxx +++ b/src/Logger/SALOME_Logger_Server_main.cxx @@ -45,7 +45,7 @@ int main(int argc, char **argv) for (i = 1; i <= NumberOfTries; i++) { -#ifndef WNT +#ifndef WIN32 if (i != 1) nanosleep(&ts_req, &ts_rem); #else if (i != 1) Sleep(TIMESleep / 1000000); diff --git a/src/Logger/SALOME_Trace.cxx b/src/Logger/SALOME_Trace.cxx index e9b9e4f6e..7e7e254bb 100644 --- a/src/Logger/SALOME_Trace.cxx +++ b/src/Logger/SALOME_Trace.cxx @@ -16,7 +16,7 @@ #include using namespace std; -#ifdef WNT +#ifdef WIN32 #include #endif @@ -57,7 +57,7 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { // searchin for naming service for 0.25*40=10 seconds for (i = 1; i <= NumberOfTries; i++) { -#ifndef WNT +#ifndef WIN32 if (i != 1) nanosleep(&ts_req,&ts_rem); #else if (i != 1) Sleep(TIMESleep / 1000000); @@ -92,7 +92,7 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { name[0].id=CORBA::string_dup("Logger"); for(i = 1; i <= NumberOfTries; i++){ -#ifndef WNT +#ifndef WIN32 if (i != 1) nanosleep(&ts_req, &ts_rem); #else if (i != 1) Sleep(TIMESleep / 1000000); diff --git a/src/Logger/SALOME_Trace.hxx b/src/Logger/SALOME_Trace.hxx index 24ef7ba8e..f5f9ea6be 100644 --- a/src/Logger/SALOME_Trace.hxx +++ b/src/Logger/SALOME_Trace.hxx @@ -16,7 +16,7 @@ #include "Logger.hh" //these declarations for files don't using OCC includes (for example HDF) -# ifdef WNT +# ifdef WIN32 # ifndef Standard_EXPORT # define Standard_EXPORT __declspec( dllexport ) @@ -30,7 +30,7 @@ # define Standard_IMPORTC extern "C" __declspec( dllimport ) # endif /* Standard_IMPORT */ -# else /* WNT */ +# else /* WIN32 */ # ifndef Standard_EXPORT # define Standard_EXPORT @@ -44,7 +44,7 @@ # define Standard_IMPORTC extern "C" # endif /* Standard_IMPORT */ -# endif /* WNT */ +# endif /* WIN32 */ class SALOME_Trace : public std::ostrstream { diff --git a/src/MPIContainer/MPIContainer_i.cxx b/src/MPIContainer/MPIContainer_i.cxx index 926a16763..287edee53 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -76,7 +76,7 @@ Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, CORBA::Object_var obj=_poa->id_to_reference(*_id); Engines::Container_var pCont = Engines::Container::_narrow(obj); - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); _containerName = _NS->BuildContainerNameForNS(containerName,hostname.c_str()); SCRUTE(_containerName); _NS->Register(pCont, _containerName.c_str()); diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx index 3208d6e89..1bc6a2075 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx @@ -503,11 +503,7 @@ void SALOME_ModuleCatalog_AcomponentImpl::duplicate _length = S_in.ServiceoutParameter.length(); S_out.ServiceoutParameter.length(_length); -#ifndef WNT for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) -#else - for (ind2 = 0; ind2 < _length ; ind2 ++) -#endif duplicate(S_out.ServiceoutParameter[ind2], S_in.ServiceoutParameter[ind2]); @@ -515,11 +511,7 @@ void SALOME_ModuleCatalog_AcomponentImpl::duplicate _length = S_in.ServiceinDataStreamParameter.length(); S_out.ServiceinDataStreamParameter.length(_length); -#ifndef WNT for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) -#else - for (ind2 = 0; ind2 < _length ; ind2 ++) -#endif duplicate(S_out.ServiceinDataStreamParameter[ind2], S_in.ServiceinDataStreamParameter[ind2]); @@ -528,11 +520,7 @@ void SALOME_ModuleCatalog_AcomponentImpl::duplicate if(MYDEBUG) SCRUTE(_length); S_out.ServiceoutDataStreamParameter.length(_length); -#ifndef WNT for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) -#else - for (ind2 = 0; ind2 < _length ; ind2 ++) -#endif duplicate(S_out.ServiceoutDataStreamParameter[ind2], S_in.ServiceoutDataStreamParameter[ind2]); } diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx index 02384368c..108eca1af 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx @@ -78,21 +78,13 @@ int main(int argc,char **argv) MESSAGE("Get Typed Component list (SUPERV Type)"); list_typed_composants = Catalogue->GetTypedComponentList(SALOME_ModuleCatalog::SUPERV); -#ifndef WNT for (unsigned int ind = 0; ind < list_typed_composants->length();ind++) -#else - for (ind = 0; ind < list_typed_composants->length();ind++) -#endif MESSAGE("Component SUPERV list : " << list_typed_composants[ind]); // Get list of couple (component name, component icone) SALOME_ModuleCatalog::ListOfIAPP_Affich_var list_composants_icone = Catalogue->GetComponentIconeList(); -#ifndef WNT for (unsigned int ind = 0; ind < list_composants_icone->length();ind++) -#else - for (ind = 0; ind < list_composants_icone->length();ind++) -#endif { MESSAGE("Component name: " << list_composants_icone[ind].modulename); MESSAGE("Component icone: " << list_composants_icone[ind].moduleicone); diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx index 55e1c0040..5362ac52c 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx @@ -73,7 +73,7 @@ int main(int argc,char **argv) for (int i = 1; i<=NumberOfTries; i++) { if (i!=1) -#ifndef WNT +#ifndef WIN32 a=nanosleep(&ts_req,&ts_rem); #else Sleep(TIMESleep/1000000); @@ -106,7 +106,7 @@ int main(int argc,char **argv) for(int j=1; j<=NumberOfTries; j++) { if (j!=1) -#ifndef WNT +#ifndef WIN32 a=nanosleep(&ts_req, &ts_rem); #else Sleep(TIMESleep/1000000); diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 01434b1a9..8c81c0290 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -130,7 +130,7 @@ SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv, CORBA: list dirList; -#ifdef WNT +#ifdef WIN32 dirList = splitStringToList(_general_path, SEPARATOR); #else //check for new format @@ -359,7 +359,7 @@ SALOME_ModuleCatalogImpl::GetComponentList() // The components in the general catalog are taken only if they're // not defined in the personal catalog -#ifndef WNT +#ifndef WIN32 for(unsigned int ind=0; ind < _general_module_list.size();ind++){ #else for(ind=0; ind < _general_module_list.size();ind++){ @@ -424,7 +424,7 @@ SALOME_ModuleCatalogImpl::GetComponentIconeList() // The components in the general catalog are taken only if they're // not defined in the personal catalog -#ifndef WNT +#ifndef WIN32 for(unsigned int ind=0; ind < _general_module_list.size();ind++){ #else for(ind=0; ind < _general_module_list.size();ind++){ @@ -519,7 +519,7 @@ SALOME_ModuleCatalogImpl::GetTypedComponentList(SALOME_ModuleCatalog::ComponentT // The components in the general catalog are taken only if they're // not defined in the personal catalog -#ifndef WNT +#ifndef WIN32 for (unsigned int ind=0; ind < _general_module_list.size();ind++) #else for (ind=0; ind < _general_module_list.size();ind++) @@ -824,7 +824,7 @@ void SALOME_ModuleCatalogImpl::duplicate _length = S_parser.outParameters.size(); S_corba.ServiceoutParameter.length(_length); -#ifndef WNT +#ifndef WIN32 for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) #else for (ind2 = 0; ind2 < _length ; ind2 ++) @@ -836,7 +836,7 @@ void SALOME_ModuleCatalogImpl::duplicate _length = S_parser.inDataStreamParameters.size(); S_corba.ServiceinDataStreamParameter.length(_length); -#ifndef WNT +#ifndef WIN32 for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) #else for (ind2 = 0; ind2 < _length ; ind2 ++) @@ -849,7 +849,7 @@ void SALOME_ModuleCatalogImpl::duplicate // if(MYDEBUG) SCRUTE(_length); S_corba.ServiceoutDataStreamParameter.length(_length); -#ifndef WNT +#ifndef WIN32 for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) #else for (ind2 = 0; ind2 < _length ; ind2 ++) @@ -947,11 +947,7 @@ SALOME_ModuleCatalogImpl::_verify_path_prefix(ParserPathPrefixes & pathList) } // Parse if a computer name is twice in the list of computers -#ifndef WNT for (unsigned int ind = 0; ind < _machine_list.size(); ind++) -#else - for (ind = 0; ind < _machine_list.size(); ind++) -#endif { for (unsigned int ind1 = ind+1 ; ind1 < _machine_list.size(); ind1++) { diff --git a/src/NOTIFICATION_SWIG/SALOME_NOTIFICATION_SWIG.hxx b/src/NOTIFICATION_SWIG/SALOME_NOTIFICATION_SWIG.hxx index 33d751c91..23f3c05bc 100755 --- a/src/NOTIFICATION_SWIG/SALOME_NOTIFICATION_SWIG.hxx +++ b/src/NOTIFICATION_SWIG/SALOME_NOTIFICATION_SWIG.hxx @@ -26,22 +26,14 @@ #ifndef _SALOME_NOTIFICATION_SWIG_HXX_ #define _SALOME_NOTIFICATION_SWIG_HXX_ -#ifdef WNT - #if defined NOTIFICATION_SWIG_EXPORTS - #if defined WIN32 - #define NOTIFICATION_SWIG_EXPORT __declspec( dllexport ) - #else - #define NOTIFICATION_SWIG_EXPORT - #endif - #else - #if defined WIN32 - #define NOTIFICATION_SWIG_EXPORT __declspec( dllimport ) - #else - #define NOTIFICATION_SWIG_EXPORT - #endif - #endif +#ifdef WIN32 +# ifdef NOTIFICATION_SWIG_EXPORTS +# define NOTIFICATION_SWIG_EXPORT __declspec( dllexport ) +# else +# define NOTIFICATION_SWIG_EXPORT __declspec( dllimport ) +# endif #else - #define NOTIFICATION_SWIG_EXPORT +# define NOTIFICATION_SWIG_EXPORT #endif #endif diff --git a/src/NamingService/Makefile.am b/src/NamingService/Makefile.am index a371d7e1c..3717f4377 100644 --- a/src/NamingService/Makefile.am +++ b/src/NamingService/Makefile.am @@ -32,7 +32,8 @@ include $(top_srcdir)/salome_adm/unix/make_common_starter.am salomeinclude_HEADERS =\ SALOME_NamingService.hxx \ ServiceUnreachable.hxx \ - NamingService_WaitForServerReadiness.hxx + NamingService_WaitForServerReadiness.hxx \ + SALOME_NamingService_defs.hxx # Scripts to be exported dist_salomescript_DATA =\ diff --git a/src/NamingService/NamingService_WaitForServerReadiness.cxx b/src/NamingService/NamingService_WaitForServerReadiness.cxx index d4eb2aa7e..0cdc78ad5 100644 --- a/src/NamingService/NamingService_WaitForServerReadiness.cxx +++ b/src/NamingService/NamingService_WaitForServerReadiness.cxx @@ -79,7 +79,7 @@ void NamingService_WaitForServerReadiness(SALOME_NamingService* NS, break; // server found, no more try to do } MESSAGE("Server "<< serverName <<" not yet ready, waiting..."); -#ifndef WNT +#ifndef WIN32 nanosleep(&ts_req,&ts_rem); // wait before retry #else Sleep(TIMESleep/1000000); @@ -89,7 +89,7 @@ void NamingService_WaitForServerReadiness(SALOME_NamingService* NS, catch( ServiceUnreachable& ) { MESSAGE("CORBA::COMM_FAILURE: Naming Service not yet ready, waiting..."); -#ifndef WNT +#ifndef WIN32 nanosleep(&ts_req,&ts_rem); // wait before retry #else Sleep(TIMESleep/1000000); diff --git a/src/NamingService/SALOME_NamingService.hxx b/src/NamingService/SALOME_NamingService.hxx index 35f174766..ce23e360e 100644 --- a/src/NamingService/SALOME_NamingService.hxx +++ b/src/NamingService/SALOME_NamingService.hxx @@ -39,15 +39,7 @@ #include "Utils_Mutex.hxx" #include "ServiceUnreachable.hxx" -#ifdef WIN32 -# ifdef NAMINGSERVICE_EXPORTS -# define NAMINGSERVICE_EXPORT __declspec( dllexport ) -# else -# define NAMINGSERVICE_EXPORT __declspec( dllimport ) -# endif -#else -# define NAMINGSERVICE_EXPORT -#endif +#include "SALOME_NamingService_defs.hxx" class NAMINGSERVICE_EXPORT SALOME_NamingService { diff --git a/src/NamingService/SALOME_NamingService_defs.hxx b/src/NamingService/SALOME_NamingService_defs.hxx new file mode 100644 index 000000000..32feab74e --- /dev/null +++ b/src/NamingService/SALOME_NamingService_defs.hxx @@ -0,0 +1,42 @@ +// SALOME NamingService : wrapping NamingService services +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : SALOME_NamingService_defs.hxx +// Author : Alexander A. BORODIN +// Module : SALOME +// $Header$ + +#ifndef SALOME_NAMINGSERVICE_DEFS_HXX +#define SALOME_NAMINGSERVICE_DEFS_HXX + +#ifdef WIN32 +# ifdef NAMINGSERVICE_EXPORTS +# define NAMINGSERVICE_EXPORT __declspec( dllexport ) +# else +# define NAMINGSERVICE_EXPORT __declspec( dllimport ) +# endif +#else +# define NAMINGSERVICE_EXPORT +#endif + +#endif //SALOME_NAMINGSERVICE_DEFS_HXX diff --git a/src/NamingService/ServiceUnreachable.hxx b/src/NamingService/ServiceUnreachable.hxx index 496f376fe..14ffae697 100644 --- a/src/NamingService/ServiceUnreachable.hxx +++ b/src/NamingService/ServiceUnreachable.hxx @@ -29,20 +29,7 @@ #if !defined ( SERVICEUNREACHABLE_H ) #define SERVICEUNREACHABLE_H -#if defined NAMINGSERVICE_EXPORTS -#if defined WNT -#define NAMINGSERVICE_EXPORT __declspec( dllexport ) -#else -#define NAMINGSERVICE_EXPORT -#endif -#else -#if defined WNT -#define NAMINGSERVICE_EXPORT __declspec( dllimport ) -#else -#define NAMINGSERVICE_EXPORT -#endif -#endif - +#include "SALOME_NamingService_defs.hxx" #include "Utils_SALOME_Exception.hxx" //! exception class for NamingService : ServiceUnreachable diff --git a/src/Notification/SALOME_NOTIFICATION.hxx b/src/Notification/SALOME_NOTIFICATION.hxx index c187b4119..bc58c084e 100755 --- a/src/Notification/SALOME_NOTIFICATION.hxx +++ b/src/Notification/SALOME_NOTIFICATION.hxx @@ -26,22 +26,14 @@ #ifndef _SALOME_NOTIFICATION_HXX_ #define _SALOME_NOTIFICATION_HXX_ -#ifdef WNT - #if defined NOTIFICATION_EXPORTS - #if defined WIN32 - #define NOTIFICATION_EXPORT __declspec( dllexport ) - #else - #define NOTIFICATION_EXPORT - #endif - #else - #if defined WIN32 - #define NOTIFICATION_EXPORT __declspec( dllimport ) - #else - #define NOTIFICATION_EXPORT - #endif - #endif +#ifdef WIN32 +# ifdef NOTIFICATION_EXPORTS +# define NOTIFICATION_EXPORT __declspec( dllexport ) +# else +# define NOTIFICATION_EXPORT __declspec( dllimport ) +# endif #else - #define NOTIFICATION_EXPORT +# define NOTIFICATION_EXPORT #endif #endif diff --git a/src/ParallelContainer/SALOME_ParallelComponent_i.cxx b/src/ParallelContainer/SALOME_ParallelComponent_i.cxx index fab45e703..2931451fb 100644 --- a/src/ParallelContainer/SALOME_ParallelComponent_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelComponent_i.cxx @@ -26,15 +26,15 @@ #include "SALOME_ParallelComponent_i.hxx" #include "SALOME_ParallelContainer_i.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" #include -#ifndef WNT +#ifndef WIN32 #include #endif #include #include "utilities.h" -#ifndef WNT +#ifndef WIN32 #include #include #include @@ -304,7 +304,7 @@ bool Engines_Parallel_Component_i::Kill_impl() // << dec ) ; bool RetVal = false ; -#ifndef WNT +#ifndef WIN32 if ( _ThreadId > 0 && pthread_self() != _ThreadId ) { RetVal = Killer( _ThreadId , 0 ) ; @@ -333,12 +333,12 @@ bool Engines_Parallel_Component_i::Stop_impl() MESSAGE("Engines_Parallel_Component_i::Stop_i() pthread_t "<< pthread_self() << " pid " << getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << GetHostname().c_str()<< " _id " << hex << _id + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id << dec << " _ThreadId " << _ThreadId ); bool RetVal = false ; -#ifndef WNT +#ifndef WIN32 if ( _ThreadId > 0 && pthread_self() != _ThreadId ) { RetVal = Killer( _ThreadId , 0 ) ; @@ -365,11 +365,11 @@ bool Engines_Parallel_Component_i::Suspend_impl() MESSAGE("Engines_Parallel_Component_i::Suspend_i() pthread_t "<< pthread_self() << " pid " << getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << GetHostname().c_str()<< " _id " << hex << _id + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id << dec << " _ThreadId " << _ThreadId ); bool RetVal = false ; -#ifndef WNT +#ifndef WIN32 if ( _ThreadId > 0 && pthread_self() != _ThreadId ) #else if ( _ThreadId > 0 && pthread_self().p != _ThreadId->p ) @@ -381,7 +381,7 @@ bool Engines_Parallel_Component_i::Suspend_impl() } else { -#ifndef WNT +#ifndef WIN32 RetVal = Killer( _ThreadId ,SIGINT ) ; #else RetVal = Killer( *_ThreadId ,SIGINT ) ; @@ -404,10 +404,10 @@ bool Engines_Parallel_Component_i::Resume_impl() MESSAGE("Engines_Parallel_Component_i::Resume_i() pthread_t "<< pthread_self() << " pid " << getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << GetHostname().c_str()<< " _id " << hex << _id + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id << dec << " _ThreadId " << _ThreadId ); bool RetVal = false ; -#ifndef WNT +#ifndef WIN32 if ( _ThreadId > 0 && pthread_self() != _ThreadId ) #else if ( _ThreadId > 0 && pthread_self().p != _ThreadId->p ) @@ -439,7 +439,7 @@ CORBA::Long Engines_Parallel_Component_i::CpuUsed_impl() { if ( _ThreadId > 0 ) { -#ifndef WNT +#ifndef WIN32 if ( pthread_self() != _ThreadId ) #else if ( pthread_self().p != _ThreadId->p ) @@ -452,7 +452,7 @@ CORBA::Long Engines_Parallel_Component_i::CpuUsed_impl() { // Get Cpu in the appropriate thread with that object !... theEngines_Component = this ; -#ifndef WNT +#ifndef WIN32 Killer( _ThreadId ,SIGUSR1 ) ; #else Killer( *_ThreadId ,SIGUSR11 ) ; @@ -543,7 +543,7 @@ void Engines_Parallel_Component_i::beginService(const char *serviceName) { MESSAGE(pthread_self() << "Send BeginService notification for " < #include #include -#ifndef WNT +#ifndef WIN32 #include #endif #include @@ -45,18 +45,14 @@ class Engines_Parallel_Container_i; -#if defined CONTAINER_EXPORTS -#if defined WIN32 -#define CONTAINER_EXPORT __declspec( dllexport ) +#ifdef WIN32 +# ifdef CONTAINER_EXPORTS +# define CONTAINER_EXPORT __declspec( dllexport ) +# else +# define CONTAINER_EXPORT __declspec( dllimport ) +# endif #else -#define CONTAINER_EXPORT -#endif -#else -#if defined WNT -#define CONTAINER_EXPORT __declspec( dllimport ) -#else -#define CONTAINER_EXPORT -#endif +# define CONTAINER_EXPORT #endif class CONTAINER_EXPORT Engines_Parallel_Component_i: @@ -191,7 +187,7 @@ protected: char * _proxy; private: -#ifndef WNT +#ifndef WIN32 pthread_t _ThreadId ; #else pthread_t* _ThreadId ; diff --git a/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx b/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx index d3470b9de..bc67126b9 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx @@ -29,7 +29,7 @@ #include #include -#ifndef WNT +#ifndef WIN32 #include #else #include @@ -46,7 +46,7 @@ #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" #include "SALOMETraceCollector.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" using namespace std; @@ -135,7 +135,7 @@ int main(int argc, char* argv[]) PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj); PortableServer::POAManager_var pman = root_poa->the_POAManager(); -#ifndef WNT +#ifndef WIN32 // add this container to the kill list char aCommand[100]; sprintf(aCommand, "addToKillList.py %d SALOME_ParallelContainerNode", getpid()); @@ -170,7 +170,7 @@ int main(int argc, char* argv[]) obj = root_poa->id_to_reference(*_id); // In the NamingService - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); int myid = 0; char buffer [5]; snprintf(buffer, 5, "%d", myid); diff --git a/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx b/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx index baea9d421..aa470c9e9 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx @@ -29,7 +29,7 @@ #include #include -#ifndef WNT +#ifndef WIN32 #include #else #include @@ -49,7 +49,7 @@ #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" #include "SALOMETraceCollector.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" using namespace std; @@ -170,7 +170,7 @@ int main(int argc, char* argv[]) PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj); PortableServer::POAManager_var pman = root_poa->the_POAManager(); -#ifndef WNT +#ifndef WIN32 // add this container to the kill list char aCommand[100]; sprintf(aCommand, "addToKillList.py %d SALOME_ParallelContainerNodeMpi", getpid()); @@ -207,7 +207,7 @@ int main(int argc, char* argv[]) obj = root_poa->id_to_reference(*_id); // In the NamingService - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); int myid; MPI_Comm_rank(MPI_COMM_WORLD, &myid); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx index e8df8733b..f65000467 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx @@ -29,7 +29,7 @@ #include #include -#ifndef WNT +#ifndef WIN32 #include #else #include @@ -47,7 +47,7 @@ #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" #include "SALOMETraceCollector.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" #ifdef DEBUG_PARALLEL #include @@ -84,7 +84,7 @@ int main(int argc, char* argv[]) PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj); PortableServer::POAManager_var pman = root_poa->the_POAManager(); -#ifndef WNT +#ifndef WIN32 // add this container to the kill list char aCommand[100]; sprintf(aCommand, "addToKillList.py %d SALOME_ParallelContainerProxyDummy", getpid()); @@ -114,7 +114,7 @@ int main(int argc, char* argv[]) obj = root_poa->id_to_reference(_id); // In the NamingService - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); Engines::Container_var pCont = Engines::Container::_narrow(obj); string _containerName = ns->BuildContainerNameForNS(containerName.c_str(), hostname.c_str()); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx index f14b09e18..b8a0eaddf 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx @@ -29,7 +29,7 @@ #include #include -#ifndef WNT +#ifndef WIN32 #include #else #include @@ -48,7 +48,7 @@ #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" #include "SALOMETraceCollector.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" using namespace std; #ifdef DEBUG_PARALLEL @@ -88,7 +88,7 @@ int main(int argc, char* argv[]) PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj); PortableServer::POAManager_var pman = root_poa->the_POAManager(); -#ifndef WNT +#ifndef WIN32 // add this container to the kill list char aCommand[100]; sprintf(aCommand, "addToKillList.py %d SALOME_ParallelContainerProxyMpi", getpid()); @@ -119,7 +119,7 @@ int main(int argc, char* argv[]) obj = root_poa->id_to_reference(_id); // in the NamingService - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); Engines::Container_var pCont = Engines::Container::_narrow(obj); string _containerName = ns->BuildContainerNameForNS(containerName.c_str(), hostname.c_str()); diff --git a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx index 97f655b39..b327e1633 100644 --- a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx @@ -24,7 +24,7 @@ // Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA #include -#ifndef WNT +#ifndef WIN32 #else #include #endif @@ -35,12 +35,11 @@ #include "SALOME_FileRef_i.hxx" #include "SALOME_FileTransfer_i.hxx" #include "SALOME_NamingService.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" -#include "OpUtil.hxx" #include #include -#ifndef WNT +#ifndef WIN32 #include #include #else @@ -60,7 +59,7 @@ bool _Sleeping = false ; // Other Containers are started via start_impl of FactoryServer extern "C" {void ActSigIntHandler() ; } -#ifndef WNT +#ifndef WIN32 extern "C" {void SigIntHandler(int, siginfo_t *, void *) ; } #else extern "C" {void SigIntHandler( int ) ; } @@ -114,7 +113,7 @@ Engines_Parallel_Container_i::Engines_Parallel_Container_i (CORBA::ORB_ptr orb, _argc = argc ; _argv = argv ; - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); _orb = CORBA::ORB::_duplicate(orb) ; _poa = PortableServer::POA::_duplicate(poa) ; @@ -157,7 +156,7 @@ char* Engines_Parallel_Container_i::name() char* Engines_Parallel_Container_i::getHostName() { - string s = GetHostname(); + string s = Kernel_Utils::GetHostname(); MESSAGE("Engines_Parallel_Container_i::getHostName " << s); return CORBA::string_dup(s.c_str()) ; } @@ -226,7 +225,7 @@ Engines_Parallel_Container_i::load_component_Library(const char* componentName) string aCompName = componentName; // --- try dlopen C++ component -#ifndef WNT +#ifndef WIN32 string impl_name = string ("lib") + aCompName + string("Engine.so"); #else string impl_name = aCompName + string("Engine.dll"); @@ -244,7 +243,7 @@ Engines_Parallel_Container_i::load_component_Library(const char* componentName) } void* handle; -#ifndef WNT +#ifndef WIN32 handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ; #else handle = dlopen( impl_name.c_str() , 0 ) ; @@ -305,7 +304,7 @@ Engines_Parallel_Container_i::create_component_instance(const char*genericRegist } //--- try C++ -#ifndef WNT +#ifndef WIN32 string impl_name = string ("lib") + aCompName +string("Engine.so"); #else string impl_name = aCompName +string("Engine.dll"); @@ -452,7 +451,7 @@ bool Engines_Parallel_Container_i::Kill_impl() { MESSAGE("Engines_Parallel_Container_i::Kill() pid "<< getpid() << " containerName " << _containerName.c_str() << " machineName " - << GetHostname().c_str()); + << Kernel_Utils::GetHostname().c_str()); INFOS("==============================================================="); INFOS("= REMOVE calls to Kill_impl in C++ container ="); INFOS("==============================================================="); @@ -730,7 +729,7 @@ Engines_Parallel_Container_i::createParallelInstance(string genericRegisterName, string instanceName = aGenRegisterName + "_inst_" + aNumI ; string component_registerName = _containerName + "/" + instanceName; - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); CORBA::Object_var temp = _NS->Resolve(component_registerName.c_str()); Engines::Component_var obj_proxy = Engines::Component::_narrow(temp); @@ -850,7 +849,7 @@ bool Engines_Parallel_Container_i::isPythonContainer(const char* ContainerName) void ActSigIntHandler() { -#ifndef WNT +#ifndef WIN32 struct sigaction SigIntAct ; SigIntAct.sa_sigaction = &SigIntHandler ; SigIntAct.sa_flags = SA_SIGINFO ; @@ -860,7 +859,7 @@ void ActSigIntHandler() // (SIGINT | SIGUSR1) : // it must be only one signal ===> one call for SIGINT // and an other one for SIGUSR1 -#ifndef WNT +#ifndef WIN32 if ( sigaction( SIGINT , &SigIntAct, NULL ) ) { perror("SALOME_Container main ") ; exit(0) ; @@ -885,7 +884,7 @@ void ActSigIntHandler() void SetCpuUsed() ; -#ifndef WNT +#ifndef WIN32 void SigIntHandler(int what , siginfo_t * siginfo , void * toto ) { //PAL9042 JR : during the execution of a Signal Handler (and of methods called through Signal Handlers) @@ -921,7 +920,7 @@ void SigIntHandler(int what , siginfo_t * siginfo , return ; } } -#else // Case WNT +#else // Case WIN32 void SigIntHandler( int what ) { MESSAGE( pthread_self() << "SigIntHandler what " << what << endl ); if ( _Sleeping ) { diff --git a/src/ParallelContainer/SALOME_ParallelContainer_i.hxx b/src/ParallelContainer/SALOME_ParallelContainer_i.hxx index 34d980fdb..1c2efb303 100644 --- a/src/ParallelContainer/SALOME_ParallelContainer_i.hxx +++ b/src/ParallelContainer/SALOME_ParallelContainer_i.hxx @@ -33,7 +33,7 @@ #include #include #include -#ifndef WNT +#ifndef WIN32 #include #endif #include @@ -43,19 +43,14 @@ class SALOME_NamingService; - -#if defined CONTAINER_EXPORTS -#if defined WIN32 -#define CONTAINER_EXPORT __declspec( dllexport ) -#else -#define CONTAINER_EXPORT -#endif +#ifdef WIN32 +# ifdef CONTAINER_EXPORTS +# define CONTAINER_EXPORT __declspec( dllexport ) +# else +# define CONTAINER_EXPORT __declspec( dllimport ) +# endif #else -#if defined WNT -#define CONTAINER_EXPORT __declspec( dllimport ) -#else -#define CONTAINER_EXPORT -#endif +# define CONTAINER_EXPORT #endif class CONTAINER_EXPORT Engines_Parallel_Container_i: