From a1ac5357564751211e4aaeebbdb915cfc09a60f9 Mon Sep 17 00:00:00 2001 From: abd Date: Thu, 17 Jul 2008 06:28:31 +0000 Subject: [PATCH] Executable version on Windows Platform --- .../Batch_APIInternalFailureException.hxx | 3 +- src/Batch/Batch_BatchManager.cxx | 7 +- src/Batch/Batch_BatchManager.hxx | 4 +- src/Batch/Batch_BatchManagerCatalog.hxx | 4 +- src/Batch/Batch_BoolType.hxx | 4 +- src/Batch/Batch_CharType.hxx | 4 +- src/Batch/Batch_ConnexionFailureException.hxx | 4 +- src/Batch/Batch_Couple.hxx | 4 +- src/Batch/Batch_CoupleType.hxx | 4 +- src/Batch/Batch_Date.hxx | 4 +- src/Batch/Batch_DateType.hxx | 4 +- src/Batch/Batch_Defines.hxx | 39 ++++ src/Batch/Batch_Environnement.hxx | 2 + src/Batch/Batch_FactBatchManager.hxx | 4 +- src/Batch/Batch_GenericException.hxx | 4 +- src/Batch/Batch_GenericType.hxx | 4 +- src/Batch/Batch_IntType.hxx | 4 +- src/Batch/Batch_InvalidArgumentException.hxx | 4 +- src/Batch/Batch_InvalidKeyException.hxx | 4 +- src/Batch/Batch_Job.hxx | 4 +- src/Batch/Batch_JobId.hxx | 4 +- src/Batch/Batch_JobInfo.hxx | 7 +- src/Batch/Batch_ListIsFullException.hxx | 4 +- src/Batch/Batch_LongType.hxx | 4 +- src/Batch/Batch_MapKey.hxx | 4 +- .../Batch_NotYetImplementedException.hxx | 4 +- src/Batch/Batch_Parametre.hxx | 6 +- src/Batch/Batch_PyVersatile.hxx | 4 +- src/Batch/Batch_RunTimeException.hxx | 4 +- src/Batch/Batch_StringType.hxx | 4 +- src/Batch/Batch_TypeMismatchException.hxx | 4 +- src/Batch/Batch_Versatile.hxx | 4 +- src/Batch/Makefile.am | 3 +- src/Container/Container_i.cxx | 5 +- src/Container/SALOME_Container.cxx | 10 +- src/Container/SALOME_Container.hxx | 22 +-- src/Container/SALOME_ContainerManager.cxx | 2 + src/Container/Salome_file_i.cxx | 31 ++- src/DSC/DSC_Basic/ConnectionManager_i.cxx | 11 +- src/HDFPersist/HDFascii.cc | 16 +- src/HDFPersist/HDFascii.hxx | 2 +- src/HDFPersist/HDFattribute.hxx | 2 +- src/HDFPersist/HDFcontainerObject.hxx | 2 +- src/HDFPersist/HDFconvert.hxx | 3 +- src/HDFPersist/HDFdataset.hxx | 2 +- src/HDFPersist/HDFexception.hxx | 4 +- src/HDFPersist/HDFexplorer.hxx | 2 +- src/HDFPersist/HDFexport.hxx | 12 +- src/HDFPersist/HDFfile.hxx | 2 +- src/HDFPersist/HDFgroup.hxx | 2 +- src/HDFPersist/HDFinternalObject.hxx | 2 +- src/HDFPersist/HDFobject.cc | 3 +- src/HDFPersist/HDFobject.hxx | 2 +- src/Launcher/BatchLight_BatchManager.cxx | 9 +- src/Launcher/BatchLight_BatchManager_PBS.cxx | 18 +- .../BatchLight_BatchManager_SLURM.cxx | 12 +- src/Launcher/BatchLight_Job.cxx | 2 +- src/Launcher/SALOME_Launcher.cxx | 15 +- src/Launcher/SALOME_Launcher.hxx | 24 +-- src/Launcher/SALOME_LauncherServer.cxx | 7 + .../SALOME_ModuleCatalog_impl.cxx | 12 +- src/NamingService/SALOME_NamingService.hxx | 18 +- .../SALOME_ResourcesManager.cxx | 12 +- .../SALOME_ResourcesManager.hxx | 18 +- src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx | 6 +- src/SALOMEDSImpl/Makefile.am | 2 + .../SALOMEDSImpl_AttributeComment.cxx | 10 +- .../SALOMEDSImpl_AttributeComment.hxx | 32 +-- .../SALOMEDSImpl_AttributeDrawable.hxx | 40 ++-- .../SALOMEDSImpl_AttributeExpandable.hxx | 36 ++-- .../SALOMEDSImpl_AttributeExternalFileDef.hxx | 37 ++-- .../SALOMEDSImpl_AttributeFileType.hxx | 37 ++-- .../SALOMEDSImpl_AttributeFlags.hxx | 43 ++--- .../SALOMEDSImpl_AttributeGraphic.hxx | 43 ++--- .../SALOMEDSImpl_AttributeIOR.hxx | 28 +-- .../SALOMEDSImpl_AttributeInteger.cxx | 7 +- .../SALOMEDSImpl_AttributeInteger.hxx | 33 ++-- .../SALOMEDSImpl_AttributeLocalID.hxx | 32 +-- .../SALOMEDSImpl_AttributeName.hxx | 30 +-- .../SALOMEDSImpl_AttributeOpened.hxx | 32 +-- .../SALOMEDSImpl_AttributeParameter.hxx | 82 ++++---- .../SALOMEDSImpl_AttributePersistentRef.hxx | 34 ++-- .../SALOMEDSImpl_AttributePixMap.hxx | 36 ++-- .../SALOMEDSImpl_AttributePythonObject.hxx | 38 ++-- .../SALOMEDSImpl_AttributeReal.hxx | 28 +-- .../SALOMEDSImpl_AttributeReference.hxx | 30 +-- .../SALOMEDSImpl_AttributeSelectable.hxx | 32 +-- ...ALOMEDSImpl_AttributeSequenceOfInteger.hxx | 42 ++-- .../SALOMEDSImpl_AttributeSequenceOfReal.hxx | 42 ++-- .../SALOMEDSImpl_AttributeString.hxx | 30 +-- .../SALOMEDSImpl_AttributeStudyProperties.hxx | 99 +++++----- .../SALOMEDSImpl_AttributeTableOfInteger.hxx | 88 ++++----- .../SALOMEDSImpl_AttributeTableOfReal.hxx | 88 ++++----- .../SALOMEDSImpl_AttributeTableOfString.hxx | 88 ++++----- .../SALOMEDSImpl_AttributeTarget.hxx | 36 ++-- .../SALOMEDSImpl_AttributeTextColor.hxx | 28 +-- ...LOMEDSImpl_AttributeTextHighlightColor.hxx | 28 +-- .../SALOMEDSImpl_AttributeTreeNode.hxx | 108 ++++++----- .../SALOMEDSImpl_AttributeUserID.hxx | 42 ++-- src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx | 10 +- src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx | 28 +-- .../SALOMEDSImpl_ChildIterator.hxx | 34 ++-- .../SALOMEDSImpl_ChildNodeIterator.hxx | 25 +-- src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx | 39 ++++ src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx | 67 +++---- .../SALOMEDSImpl_GenericAttribute.cxx | 14 +- .../SALOMEDSImpl_GenericAttribute.hxx | 26 +-- src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx | 89 ++++----- src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx | 31 +-- .../SALOMEDSImpl_SComponentIterator.hxx | 12 +- src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx | 64 +++--- src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx | 182 +++++++++--------- .../SALOMEDSImpl_StudyBuilder.hxx | 99 +++++----- src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx | 38 ++-- .../SALOMEDSImpl_StudyManager.cxx | 18 +- .../SALOMEDSImpl_StudyManager.hxx | 110 +++++------ src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx | 9 +- src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx | 18 +- src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx | 4 +- .../SALOMEDSImpl_UseCaseBuilder.hxx | 42 ++-- .../SALOMEDSImpl_UseCaseIterator.hxx | 12 +- src/TOOLSDS/SALOMEDS_Tool.cxx | 16 +- src/Utils/OpUtil.cxx | 168 ++++++++++++++++ src/Utils/OpUtil.hxx | 20 ++ 124 files changed, 1784 insertions(+), 1293 deletions(-) create mode 100755 src/Batch/Batch_Defines.hxx create mode 100755 src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx diff --git a/src/Batch/Batch_APIInternalFailureException.hxx b/src/Batch/Batch_APIInternalFailureException.hxx index 4e5d57457..cb8bb1be8 100644 --- a/src/Batch/Batch_APIInternalFailureException.hxx +++ b/src/Batch/Batch_APIInternalFailureException.hxx @@ -30,13 +30,14 @@ #ifndef _APIINTERNALFAILUREEXCEPTION_H_ #define _APIINTERNALFAILUREEXCEPTION_H_ +#include "Batch_Defines.hxx" #include "Batch_GenericException.hxx" #include "Batch_GenericException.hxx" namespace Batch { - class APIInternalFailureException : public GenericException + class BATCH_EXPORT APIInternalFailureException : public GenericException { public: // Constructeur diff --git a/src/Batch/Batch_BatchManager.cxx b/src/Batch/Batch_BatchManager.cxx index 8d3965274..3fb947250 100644 --- a/src/Batch/Batch_BatchManager.cxx +++ b/src/Batch/Batch_BatchManager.cxx @@ -29,7 +29,12 @@ #include #include #include -#include +#ifdef WNT +# include +#else +# include +#endif + //#include "MEDMEM_STRING.hxx" #include "Batch_Job.hxx" #include "Batch_JobId.hxx" diff --git a/src/Batch/Batch_BatchManager.hxx b/src/Batch/Batch_BatchManager.hxx index 92a81a732..c00f70c0d 100644 --- a/src/Batch/Batch_BatchManager.hxx +++ b/src/Batch/Batch_BatchManager.hxx @@ -29,6 +29,8 @@ #ifndef _BATCHMANAGER_H_ #define _BATCHMANAGER_H_ +#include "Batch_Defines.hxx" + #include #include #include "Batch_Job.hxx" @@ -43,7 +45,7 @@ namespace Batch { class JobInfo; class FactBatchManager; - class BatchManager + class BATCH_EXPORT BatchManager { public: // Constructeur et destructeur diff --git a/src/Batch/Batch_BatchManagerCatalog.hxx b/src/Batch/Batch_BatchManagerCatalog.hxx index 81ab713ec..d19ae24e3 100644 --- a/src/Batch/Batch_BatchManagerCatalog.hxx +++ b/src/Batch/Batch_BatchManagerCatalog.hxx @@ -29,6 +29,8 @@ #ifndef _CATALOG_H_ #define _CATALOG_H_ +#include "Batch_Defines.hxx" + #include #include #include @@ -37,7 +39,7 @@ namespace Batch { class FactBatchManager; - class BatchManagerCatalog + class BATCH_EXPORT BatchManagerCatalog { public: // Constructeur diff --git a/src/Batch/Batch_BoolType.hxx b/src/Batch/Batch_BoolType.hxx index b367b3a02..f25c24c5f 100644 --- a/src/Batch/Batch_BoolType.hxx +++ b/src/Batch/Batch_BoolType.hxx @@ -29,12 +29,14 @@ #ifndef _BOOLTYPE_H_ #define _BOOLTYPE_H_ +#include "Batch_Defines.hxx" + #include #include "Batch_GenericType.hxx" namespace Batch { - class BoolType : public GenericType + class BATCH_EXPORT BoolType : public GenericType { public: // Constructeur diff --git a/src/Batch/Batch_CharType.hxx b/src/Batch/Batch_CharType.hxx index f4894f5d0..abac3be3a 100644 --- a/src/Batch/Batch_CharType.hxx +++ b/src/Batch/Batch_CharType.hxx @@ -29,12 +29,14 @@ #ifndef _CHARTYPE_H_ #define _CHARTYPE_H_ +#include "Batch_Defines.hxx" + #include #include "Batch_GenericType.hxx" namespace Batch { - class CharType : public GenericType + class BATCH_EXPORT CharType : public GenericType { public: // Constructeur diff --git a/src/Batch/Batch_ConnexionFailureException.hxx b/src/Batch/Batch_ConnexionFailureException.hxx index 9ae672885..0d3a47e86 100644 --- a/src/Batch/Batch_ConnexionFailureException.hxx +++ b/src/Batch/Batch_ConnexionFailureException.hxx @@ -30,12 +30,14 @@ #ifndef _CONNEXIONFAILUREEXCEPTION_H_ #define _CONNEXIONFAILUREEXCEPTION_H_ +#include "Batch_Defines.hxx" + #include "Batch_GenericException.hxx" namespace Batch { - class ConnexionFailureException : public GenericException + class BATCH_EXPORT ConnexionFailureException : public GenericException { public: // Constructeur diff --git a/src/Batch/Batch_Couple.hxx b/src/Batch/Batch_Couple.hxx index 717a1c228..9c0deed45 100644 --- a/src/Batch/Batch_Couple.hxx +++ b/src/Batch/Batch_Couple.hxx @@ -30,11 +30,13 @@ #ifndef _COUPLE_H_ #define _COUPLE_H_ +#include "Batch_Defines.hxx" + #include namespace Batch { - class Couple + class BATCH_EXPORT Couple { public: // Constructeur standard diff --git a/src/Batch/Batch_CoupleType.hxx b/src/Batch/Batch_CoupleType.hxx index 6d2500f1c..b7d323331 100644 --- a/src/Batch/Batch_CoupleType.hxx +++ b/src/Batch/Batch_CoupleType.hxx @@ -30,13 +30,15 @@ #ifndef _COUPLETYPE_H_ #define _COUPLETYPE_H_ +#include "Batch_Defines.hxx" + #include #include "Batch_GenericType.hxx" #include "Batch_Couple.hxx" namespace Batch { - class CoupleType : public GenericType + class BATCH_EXPORT CoupleType : public GenericType { public: // Constructeur diff --git a/src/Batch/Batch_Date.hxx b/src/Batch/Batch_Date.hxx index 06ebd5dd1..ff7d37a6f 100644 --- a/src/Batch/Batch_Date.hxx +++ b/src/Batch/Batch_Date.hxx @@ -30,11 +30,13 @@ #ifndef _DATE_H_ #define _DATE_H_ +#include "Batch_Defines.hxx" + #include namespace Batch { - class Date + class BATCH_EXPORT Date { public: Date(const long l=0); diff --git a/src/Batch/Batch_DateType.hxx b/src/Batch/Batch_DateType.hxx index 40a47702e..c7fef39a5 100644 --- a/src/Batch/Batch_DateType.hxx +++ b/src/Batch/Batch_DateType.hxx @@ -30,13 +30,15 @@ #ifndef _DATETYPE_H_ #define _DATETYPE_H_ +#include "Batch_Defines.hxx" + #include #include "Batch_GenericType.hxx" #include "Batch_Date.hxx" namespace Batch { - class DateType : public GenericType + class BATCH_EXPORT DateType : public GenericType { public: // Constructeur diff --git a/src/Batch/Batch_Defines.hxx b/src/Batch/Batch_Defines.hxx new file mode 100755 index 000000000..cd66ca5ff --- /dev/null +++ b/src/Batch/Batch_Defines.hxx @@ -0,0 +1,39 @@ +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : Batch_Defines.hxx +// Author : Alexander A. BORODIN +// Module : SALOME + +#ifndef _BATCH_Defines_HXX_ +#define _BATCH_Defines_HXX_ + +#ifdef WNT +# ifdef BATCH_EXPORTS +# define BATCH_EXPORT __declspec( dllexport ) +# else +# define BATCH_EXPORT __declspec( dllimport ) +# endif +#else +# define BATCH_EXPORT +#endif + +#endif diff --git a/src/Batch/Batch_Environnement.hxx b/src/Batch/Batch_Environnement.hxx index 2fb9c73a0..e1e16f654 100644 --- a/src/Batch/Batch_Environnement.hxx +++ b/src/Batch/Batch_Environnement.hxx @@ -30,6 +30,8 @@ #ifndef _ENVIRONNEMENT_H_ #define _ENVIRONNEMENT_H_ +#include "Batch_Defines.hxx" + #include #include diff --git a/src/Batch/Batch_FactBatchManager.hxx b/src/Batch/Batch_FactBatchManager.hxx index 71d739ef0..3a229be30 100644 --- a/src/Batch/Batch_FactBatchManager.hxx +++ b/src/Batch/Batch_FactBatchManager.hxx @@ -29,6 +29,8 @@ #ifndef _FACTBATCHMANAGER_H_ #define _FACTBATCHMANAGER_H_ +#include "Batch_Defines.hxx" + #include #include @@ -36,7 +38,7 @@ namespace Batch { class BatchManager; - class FactBatchManager + class BATCH_EXPORT FactBatchManager { public: // Constructeur et destructeur diff --git a/src/Batch/Batch_GenericException.hxx b/src/Batch/Batch_GenericException.hxx index f62b6a2b9..89f79f49a 100644 --- a/src/Batch/Batch_GenericException.hxx +++ b/src/Batch/Batch_GenericException.hxx @@ -30,12 +30,14 @@ #ifndef _GENERICEXCEPTION_H_ #define _GENERICEXCEPTION_H_ +#include "Batch_Defines.hxx" + #include namespace Batch { - class GenericException + class BATCH_EXPORT GenericException { public: const std::string type; // la nature de l'exception diff --git a/src/Batch/Batch_GenericType.hxx b/src/Batch/Batch_GenericType.hxx index 674b843ad..c5d7faf83 100644 --- a/src/Batch/Batch_GenericType.hxx +++ b/src/Batch/Batch_GenericType.hxx @@ -29,13 +29,15 @@ #ifndef _GENERICTYPE_H_ #define _GENERICTYPE_H_ +#include "Batch_Defines.hxx" + #include #include namespace Batch { - class GenericType + class BATCH_EXPORT GenericType { public: // Constructeur et destructeur diff --git a/src/Batch/Batch_IntType.hxx b/src/Batch/Batch_IntType.hxx index 82ca73a10..3808c9514 100644 --- a/src/Batch/Batch_IntType.hxx +++ b/src/Batch/Batch_IntType.hxx @@ -29,12 +29,14 @@ #ifndef _INTTYPE_H_ #define _INTTYPE_H_ +#include "Batch_Defines.hxx" + #include #include "Batch_GenericType.hxx" namespace Batch { - class IntType : public GenericType + class BATCH_EXPORT IntType : public GenericType { public: // Constructeur diff --git a/src/Batch/Batch_InvalidArgumentException.hxx b/src/Batch/Batch_InvalidArgumentException.hxx index 68b417dda..8ca04c190 100644 --- a/src/Batch/Batch_InvalidArgumentException.hxx +++ b/src/Batch/Batch_InvalidArgumentException.hxx @@ -31,12 +31,14 @@ #define _INVALIDARGUMENTEXCEPTION_H_ +#include "Batch_Defines.hxx" + #include "Batch_GenericException.hxx" #include "Batch_GenericException.hxx" namespace Batch { - class InvalidArgumentException : public GenericException + class BATCH_EXPORT InvalidArgumentException : public GenericException { public: // Constructeur diff --git a/src/Batch/Batch_InvalidKeyException.hxx b/src/Batch/Batch_InvalidKeyException.hxx index e07b876ee..7c9c7022a 100644 --- a/src/Batch/Batch_InvalidKeyException.hxx +++ b/src/Batch/Batch_InvalidKeyException.hxx @@ -30,13 +30,15 @@ #ifndef _INVALIDKEYEXCEPTION_H_ #define _INVALIDKEYEXCEPTION_H_ +#include "Batch_Defines.hxx" + #include "Batch_GenericException.hxx" #include "Batch_GenericException.hxx" namespace Batch { - class InvalidKeyException : public GenericException + class BATCH_EXPORT InvalidKeyException : public GenericException { public: // Constructeur diff --git a/src/Batch/Batch_Job.hxx b/src/Batch/Batch_Job.hxx index d6ad5442b..fabecde27 100644 --- a/src/Batch/Batch_Job.hxx +++ b/src/Batch/Batch_Job.hxx @@ -29,13 +29,15 @@ #ifndef _JOB_H_ #define _JOB_H_ +#include "Batch_Defines.hxx" + #include "Batch_Parametre.hxx" #include "Batch_Environnement.hxx" namespace Batch { - class Job + class BATCH_EXPORT Job { public: // Constructeurs et destructeur diff --git a/src/Batch/Batch_JobId.hxx b/src/Batch/Batch_JobId.hxx index 5046d6a31..9ae57d183 100644 --- a/src/Batch/Batch_JobId.hxx +++ b/src/Batch/Batch_JobId.hxx @@ -30,6 +30,8 @@ #define _JOBID_H_ +#include "Batch_Defines.hxx" + #include "Batch_JobInfo.hxx" #include "Batch_BatchManager.hxx" @@ -37,7 +39,7 @@ namespace Batch { class BatchManager; - class JobId + class BATCH_EXPORT JobId { friend class BatchManager; diff --git a/src/Batch/Batch_JobInfo.hxx b/src/Batch/Batch_JobInfo.hxx index fbb4e35b1..bb9c50b12 100644 --- a/src/Batch/Batch_JobInfo.hxx +++ b/src/Batch/Batch_JobInfo.hxx @@ -30,15 +30,18 @@ #ifndef _JOBINFO_H_ #define _JOBINFO_H_ -using namespace std; +#include "Batch_Defines.hxx" + #include #include #include "Batch_Parametre.hxx" #include "Batch_Environnement.hxx" +using namespace std; + namespace Batch { - class JobInfo + class BATCH_EXPORT JobInfo { public: // Constructeur standard et destructeur diff --git a/src/Batch/Batch_ListIsFullException.hxx b/src/Batch/Batch_ListIsFullException.hxx index 241defeb8..0525ba449 100644 --- a/src/Batch/Batch_ListIsFullException.hxx +++ b/src/Batch/Batch_ListIsFullException.hxx @@ -29,11 +29,13 @@ #ifndef _LISTISFULLEXCEPTION_H_ #define _LISTISFULLEXCEPTION_H_ +#include "Batch_Defines.hxx" + #include "Batch_GenericException.hxx" namespace Batch { - class ListIsFullException : public GenericException + class BATCH_EXPORT ListIsFullException : public GenericException { public: // Constructeur diff --git a/src/Batch/Batch_LongType.hxx b/src/Batch/Batch_LongType.hxx index f43e8615e..3970ae0e7 100644 --- a/src/Batch/Batch_LongType.hxx +++ b/src/Batch/Batch_LongType.hxx @@ -29,12 +29,14 @@ #ifndef _LONGTYPE_H_ #define _LONGTYPE_H_ +#include "Batch_Defines.hxx" + #include #include "Batch_GenericType.hxx" namespace Batch { - class LongType : public GenericType + class BATCH_EXPORT LongType : public GenericType { public: // Constructeur diff --git a/src/Batch/Batch_MapKey.hxx b/src/Batch/Batch_MapKey.hxx index 93f219842..43e943f8b 100644 --- a/src/Batch/Batch_MapKey.hxx +++ b/src/Batch/Batch_MapKey.hxx @@ -30,6 +30,8 @@ #ifndef _MAPKEY_H_ #define _MAPKEY_H_ +#include "Batch_Defines.hxx" + #include @@ -37,7 +39,7 @@ namespace Batch { // une classe privee pour les differents types // ces types ne peuvent pas etre redefinis - class MapKey : public std::string + class BATCH_EXPORT MapKey : public std::string { private: friend class Parametre; // seule la classe Parametre peut creer des MapKey diff --git a/src/Batch/Batch_NotYetImplementedException.hxx b/src/Batch/Batch_NotYetImplementedException.hxx index 54f4f6205..2ca75a1e1 100644 --- a/src/Batch/Batch_NotYetImplementedException.hxx +++ b/src/Batch/Batch_NotYetImplementedException.hxx @@ -30,13 +30,15 @@ #ifndef _NOTYETIMPLEMENTEDEXCEPTION_H_ #define _NOTYETIMPLEMENTEDEXCEPTION_H_ +#include "Batch_Defines.hxx" + #include "Batch_GenericException.hxx" using namespace std; namespace Batch { - class NotYetImplementedException : public GenericException + class BATCH_EXPORT NotYetImplementedException : public GenericException { public: // Constructeur diff --git a/src/Batch/Batch_Parametre.hxx b/src/Batch/Batch_Parametre.hxx index bd9a9f294..7efc677c3 100644 --- a/src/Batch/Batch_Parametre.hxx +++ b/src/Batch/Batch_Parametre.hxx @@ -29,12 +29,14 @@ #ifndef _PARAMETRE_H_ #define _PARAMETRE_H_ -using namespace std; +#include "Batch_Defines.hxx" + #include #include #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 @@ -47,7 +49,7 @@ using namespace std; namespace Batch { - class Parametre : public map< string, Versatile > + class BATCH_EXPORT Parametre : public map< string, Versatile > { public: // Constructeur standard diff --git a/src/Batch/Batch_PyVersatile.hxx b/src/Batch/Batch_PyVersatile.hxx index e111bac43..8a26209ad 100644 --- a/src/Batch/Batch_PyVersatile.hxx +++ b/src/Batch/Batch_PyVersatile.hxx @@ -31,6 +31,8 @@ #define _PYVERSATILE_H_ +#include "Batch_Defines.hxx" + #include #include "Batch_Versatile.hxx" #include "Batch_TypeMismatchException.hxx" @@ -40,7 +42,7 @@ using namespace std; namespace Batch { - class PyVersatile : public Versatile + class BATCH_EXPORT PyVersatile : public Versatile { public: // Constructeur a partir d'un objet Versatile diff --git a/src/Batch/Batch_RunTimeException.hxx b/src/Batch/Batch_RunTimeException.hxx index 3df53a5ca..fe1e168d4 100644 --- a/src/Batch/Batch_RunTimeException.hxx +++ b/src/Batch/Batch_RunTimeException.hxx @@ -30,12 +30,14 @@ #ifndef _RUNTIMEEXCEPTION_H_ #define _RUNTIMEEXCEPTION_H_ +#include "Batch_Defines.hxx" + #include "Batch_GenericException.hxx" namespace Batch { - class RunTimeException : public GenericException + class BATCH_EXPORT RunTimeException : public GenericException { public: // Constructeur diff --git a/src/Batch/Batch_StringType.hxx b/src/Batch/Batch_StringType.hxx index a72173c7e..510924e9b 100644 --- a/src/Batch/Batch_StringType.hxx +++ b/src/Batch/Batch_StringType.hxx @@ -29,12 +29,14 @@ #ifndef _STRINGTYPE_H_ #define _STRINGTYPE_H_ +#include "Batch_Defines.hxx" + #include #include "Batch_GenericType.hxx" namespace Batch { - class StringType : public GenericType + class BATCH_EXPORT StringType : public GenericType { public: // Constructeur diff --git a/src/Batch/Batch_TypeMismatchException.hxx b/src/Batch/Batch_TypeMismatchException.hxx index d235ec20e..b231060dc 100644 --- a/src/Batch/Batch_TypeMismatchException.hxx +++ b/src/Batch/Batch_TypeMismatchException.hxx @@ -29,12 +29,14 @@ #ifndef _TYPEMISMATCHEXCEPTION_H_ #define _TYPEMISMATCHEXCEPTION_H_ +#include "Batch_Defines.hxx" + #include "Batch_GenericException.hxx" namespace Batch { - class TypeMismatchException : public GenericException + class BATCH_EXPORT TypeMismatchException : public GenericException { public: // Constructeur diff --git a/src/Batch/Batch_Versatile.hxx b/src/Batch/Batch_Versatile.hxx index cf97bbb30..c7b6f3bf6 100644 --- a/src/Batch/Batch_Versatile.hxx +++ b/src/Batch/Batch_Versatile.hxx @@ -29,6 +29,8 @@ #ifndef _VERSATILE_H_ #define _VERSATILE_H_ +#include "Batch_Defines.hxx" + #include #include #include @@ -53,7 +55,7 @@ namespace Batch { int maxelem; // le nombre d'elements autorises } TypeParam; - class Versatile : public std::list< GenericType * > + class BATCH_EXPORT Versatile : public std::list< GenericType * > { public: // Constructeur standard et destructeur diff --git a/src/Batch/Makefile.am b/src/Batch/Makefile.am index 0ec62e54c..55496d9f2 100644 --- a/src/Batch/Makefile.am +++ b/src/Batch/Makefile.am @@ -59,7 +59,8 @@ LIB_INCLUDES = \ Batch_PyVersatile.hxx \ Batch_RunTimeException.hxx \ Batch_StringType.hxx \ - Batch_TypeMismatchException.hxx + Batch_TypeMismatchException.hxx \ + Batch_Defines.hxx LIB_SRC = \ diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 41e2b5b61..e7f75cf58 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -37,17 +37,14 @@ #else #include #include +#include int SIGUSR1 = 1000; #endif #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" diff --git a/src/Container/SALOME_Container.cxx b/src/Container/SALOME_Container.cxx index 39812040d..51bc4ca8c 100644 --- a/src/Container/SALOME_Container.cxx +++ b/src/Container/SALOME_Container.cxx @@ -65,8 +65,11 @@ extern "C" void HandleServerSideSignals(CORBA::ORB_ptr theORB); #include #include #include -#include +#ifndef WIN32 +# include +#endif +#ifndef WIN32 typedef void (*sighandler_t)(int); sighandler_t setsig(int sig, sighandler_t handler) { @@ -78,9 +81,11 @@ sighandler_t setsig(int sig, sighandler_t handler) return SIG_ERR; return ocontext.sa_handler; } +#endif //WIN32 void AttachDebugger() { +#ifndef WIN32 if(getenv ("DEBUGGER")) { std::stringstream exec; @@ -89,6 +94,7 @@ void AttachDebugger() system(exec.str().c_str()); while(1); } +#endif } void Handler(int theSigId) @@ -117,12 +123,14 @@ int main(int argc, char* argv[]) MPI_Init(&argc,&argv); #endif +#ifndef WIN32 if(getenv ("DEBUGGER")) { setsig(SIGSEGV,&Handler); set_terminate(&terminateHandler); set_unexpected(&unexpectedHandler); } +#endif // Initialise the ORB. //SRN: BugID: IPAL9541, it's necessary to set a size of one message to be at least 100Mb diff --git a/src/Container/SALOME_Container.hxx b/src/Container/SALOME_Container.hxx index 4d3ff13a0..76a8cc9a8 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 +# if defined 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 dd6ee5a30..c7881e013 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -26,7 +26,9 @@ #endif #include #include "Utils_CorbaException.hxx" +#ifndef WNT //not ported #include "Batch_Date.hxx" +#endif #ifdef WITH_PACO_PARALLEL #include "PaCO++.h" diff --git a/src/Container/Salome_file_i.cxx b/src/Container/Salome_file_i.cxx index a098c06f9..5654cb516 100644 --- a/src/Container/Salome_file_i.cxx +++ b/src/Container/Salome_file_i.cxx @@ -25,10 +25,18 @@ #include "Salome_file_i.hxx" #include "utilities.h" -#include -#include #include "HDFOI.hxx" #include +#ifndef WNT +# include +# define _getcwd getcwd +# define _open open +#else +# include +# include +# include +#endif + //============================================================================= /*! @@ -39,7 +47,12 @@ Salome_file_i::Salome_file_i() { _fileId = 0; +#ifndef WIN32 _path_max = 1 + pathconf("/", _PC_PATH_MAX); +#else + _path_max = 32768; //from MSDN. + //for full compablity with FAT32, needs _MAX_PATH +#endif _state.name = CORBA::string_dup(""); _state.hdf5_file_name = CORBA::string_dup(""); _state.number_of_files = 0; @@ -155,8 +168,8 @@ Salome_file_i::load(const char* hdf5_file) { if (mode == "all") { // Changing path, is now current directory - char CurrentPath[_path_max]; - getcwd(CurrentPath, _path_max); + char* CurrentPath = new char[_path_max]; + _getcwd(CurrentPath, _path_max); path = CurrentPath; std::string group_name("GROUP"); @@ -168,7 +181,7 @@ Salome_file_i::load(const char* hdf5_file) { size = hdf_dataset->GetSize(); buffer = new char[size]; - if ( (fd = ::open(file_name.c_str(),O_RDWR|O_CREAT,00666)) <0) { + if ( (fd = ::_open(file_name.c_str(),O_RDWR|O_CREAT,00666)) <0) { SALOME::ExceptionStruct es; es.type = SALOME::INTERNAL_ERROR; std::string text = "open failed"; @@ -492,8 +505,8 @@ Salome_file_i::setLocalFile(const char* comp_file_name) else { file_name = comp_file_name; - char CurrentPath[_path_max]; - getcwd(CurrentPath, _path_max); + char* CurrentPath = new char[_path_max]; + _getcwd(CurrentPath, _path_max); path = CurrentPath; } @@ -556,8 +569,8 @@ Salome_file_i::setDistributedFile(const char* comp_file_name) else { file_name = comp_file_name; - char CurrentPath[_path_max]; - getcwd(CurrentPath, _path_max); + char* CurrentPath = new char[_path_max]; + _getcwd(CurrentPath, _path_max); path = CurrentPath; } diff --git a/src/DSC/DSC_Basic/ConnectionManager_i.cxx b/src/DSC/DSC_Basic/ConnectionManager_i.cxx index 2f7f089c9..4b73f52f9 100644 --- a/src/DSC/DSC_Basic/ConnectionManager_i.cxx +++ b/src/DSC/DSC_Basic/ConnectionManager_i.cxx @@ -26,6 +26,10 @@ #include "ConnectionManager_i.hxx" #include "SALOME_NamingService.hxx" +#ifdef WIN32 +# include +#endif + ConnectionManager_i::ConnectionManager_i(CORBA::ORB_ptr orb) { _orb = CORBA::ORB::_duplicate(orb) ; SALOME_NamingService * ns = new SALOME_NamingService(orb); @@ -126,5 +130,10 @@ ConnectionManager_i::ShutdownWithExit() CORBA::Long ConnectionManager_i::getPID() { - return (CORBA::Long)getpid(); + return +#ifndef WIN32 + (CORBA::Long)getpid(); +#else + (CORBA::Long)_getpid(); +#endif } diff --git a/src/HDFPersist/HDFascii.cc b/src/HDFPersist/HDFascii.cc index 5e1cf18a8..4c265f63e 100644 --- a/src/HDFPersist/HDFascii.cc +++ b/src/HDFPersist/HDFascii.cc @@ -35,6 +35,10 @@ #ifdef WNT #include #include +#include +#define dir_separator '\\' +#else +#define dir_separator '/' #endif using namespace std; @@ -653,11 +657,12 @@ string GetTmpDir() char *Tmp_dir = getenv("SALOME_TMP_DIR"); if(Tmp_dir != NULL) { aTmpDir = string(Tmp_dir); -#ifdef WIN32 + if(aTmpDir[aTmpDir.size()-1] != dir_separator) aTmpDir+=dir_separator; +/*#ifdef WIN32 if(aTmpDir[aTmpDir.size()-1] != '\\') aTmpDir+='\\'; #else if(aTmpDir[aTmpDir.size()-1] != '/') aTmpDir+='/'; -#endif +#endif*/ } else { #ifdef WIN32 @@ -676,11 +681,14 @@ string GetTmpDir() aTmpDir += aSubDir; //Get RND sub directory + if(aTmpDir[aTmpDir.size()-1] != dir_separator) aTmpDir+=dir_separator; +/* #ifdef WIN32 if(aTmpDir[aTmpDir.size()-1] != '\\') aTmpDir+='\\'; #else if(aTmpDir[aTmpDir.size()-1] != '/') aTmpDir+='/'; #endif + */ string aDir = aTmpDir; @@ -690,12 +698,14 @@ string GetTmpDir() } #ifdef WNT + //fuction CreateDirectory create only final directory, but not intermediate + CreateDirectory(aTmpDir.c_str(), NULL); CreateDirectory(aDir.c_str(), NULL); #else mkdir(aDir.c_str(), 0x1ff); #endif - return aDir; + return aDir + dir_separator; } char* makeName(char* name) diff --git a/src/HDFPersist/HDFascii.hxx b/src/HDFPersist/HDFascii.hxx index 999b17352..254fc9de5 100644 --- a/src/HDFPersist/HDFascii.hxx +++ b/src/HDFPersist/HDFascii.hxx @@ -31,7 +31,7 @@ #include "HDFexport.hxx" -class HDF_EXPORT HDFascii +class HDFPERSIST_EXPORT HDFascii { public: diff --git a/src/HDFPersist/HDFattribute.hxx b/src/HDFPersist/HDFattribute.hxx index 9ec84e75b..9ede64cec 100644 --- a/src/HDFPersist/HDFattribute.hxx +++ b/src/HDFPersist/HDFattribute.hxx @@ -34,7 +34,7 @@ extern "C" #include "HDFinternalObject.hxx" #include "HDFcontainerObject.hxx" -class HDFattribute : public HDFobject +class HDFPERSIST_EXPORT HDFattribute : public HDFobject { private : HDFinternalObject *_father; diff --git a/src/HDFPersist/HDFcontainerObject.hxx b/src/HDFPersist/HDFcontainerObject.hxx index dfc237b26..117145c94 100644 --- a/src/HDFPersist/HDFcontainerObject.hxx +++ b/src/HDFPersist/HDFcontainerObject.hxx @@ -35,7 +35,7 @@ extern "C" #include "HDFinternalObject.hxx" #include "HDFexport.hxx" -class HDF_EXPORT HDFcontainerObject : public HDFinternalObject +class HDFPERSIST_EXPORT HDFcontainerObject : public HDFinternalObject { private : HDFinternalObject *_firstson; diff --git a/src/HDFPersist/HDFconvert.hxx b/src/HDFPersist/HDFconvert.hxx index 20b65affd..e4fae3a06 100644 --- a/src/HDFPersist/HDFconvert.hxx +++ b/src/HDFPersist/HDFconvert.hxx @@ -41,13 +41,14 @@ extern "C" #include #include } +#include "HDFexport.hxx" #include "HDFcontainerObject.hxx" #include "HDFdataset.hxx" #include "HDFfile.hxx" #include -class HDFConvert +class HDFPERSIST_EXPORT HDFConvert { private: diff --git a/src/HDFPersist/HDFdataset.hxx b/src/HDFPersist/HDFdataset.hxx index 1e2a62401..b27f8bade 100644 --- a/src/HDFPersist/HDFdataset.hxx +++ b/src/HDFPersist/HDFdataset.hxx @@ -35,7 +35,7 @@ extern "C" #include "HDFcontainerObject.hxx" #include "HDFexport.hxx" -class HDF_EXPORT HDFdataset : public HDFinternalObject +class HDFPERSIST_EXPORT HDFdataset : public HDFinternalObject { private : HDFcontainerObject *_father; diff --git a/src/HDFPersist/HDFexception.hxx b/src/HDFPersist/HDFexception.hxx index 2ec2ce4a5..29b925ed0 100644 --- a/src/HDFPersist/HDFexception.hxx +++ b/src/HDFPersist/HDFexception.hxx @@ -27,11 +27,13 @@ #ifndef __HDFexception_H__ #define __HDFexception_H__ +#include + /* Exception */ #include -class HDFexception +class HDFPERSIST_EXPORT HDFexception { public : HDFexception(const char *message) { diff --git a/src/HDFPersist/HDFexplorer.hxx b/src/HDFPersist/HDFexplorer.hxx index e66fbe390..c2d5f3682 100644 --- a/src/HDFPersist/HDFexplorer.hxx +++ b/src/HDFPersist/HDFexplorer.hxx @@ -30,7 +30,7 @@ #include "HDFinternalObject.hxx" #include "HDFcontainerObject.hxx" -class HDFexplorer { +class HDFPERSIST_EXPORT HDFexplorer { private : int _size; HDFcontainerObject *_container; diff --git a/src/HDFPersist/HDFexport.hxx b/src/HDFPersist/HDFexport.hxx index 21b64d34e..6fbcb0bc7 100644 --- a/src/HDFPersist/HDFexport.hxx +++ b/src/HDFPersist/HDFexport.hxx @@ -27,13 +27,13 @@ #define _HDF_export_HXX_ #ifdef WNT - #if defined WIN32 - #define HDF_EXPORT __declspec( dllimport ) - #else - #define HDF_EXPORT - #endif +# ifdef HDFPERSIST_EXPORTS +# define HDFPERSIST_EXPORT __declspec( dllexport ) +# else +# define HDFPERSIST_EXPORT __declspec( dllimport ) +# endif #else - #define HDF_EXPORT +# define HDFPERSIST_EXPORT #endif #endif diff --git a/src/HDFPersist/HDFfile.hxx b/src/HDFPersist/HDFfile.hxx index 51c9aa7f1..b769ee869 100644 --- a/src/HDFPersist/HDFfile.hxx +++ b/src/HDFPersist/HDFfile.hxx @@ -34,7 +34,7 @@ extern "C" #include "HDFcontainerObject.hxx" #include "HDFexport.hxx" -class HDF_EXPORT HDFfile : public HDFcontainerObject +class HDFPERSIST_EXPORT HDFfile : public HDFcontainerObject { private : hdf_access_mode _access_mode; diff --git a/src/HDFPersist/HDFgroup.hxx b/src/HDFPersist/HDFgroup.hxx index 8c0d02b88..8e9e002b2 100644 --- a/src/HDFPersist/HDFgroup.hxx +++ b/src/HDFPersist/HDFgroup.hxx @@ -34,7 +34,7 @@ extern "C" #include "HDFcontainerObject.hxx" #include "HDFexport.hxx" -class HDF_EXPORT HDFgroup : public HDFcontainerObject +class HDFPERSIST_EXPORT HDFgroup : public HDFcontainerObject { private : HDFcontainerObject *_father; diff --git a/src/HDFPersist/HDFinternalObject.hxx b/src/HDFPersist/HDFinternalObject.hxx index ee4c32e51..232305016 100644 --- a/src/HDFPersist/HDFinternalObject.hxx +++ b/src/HDFPersist/HDFinternalObject.hxx @@ -34,7 +34,7 @@ extern "C" #include "HDFobject.hxx" #include "HDFexport.hxx" -class HDF_EXPORT HDFinternalObject : public HDFobject +class HDFPERSIST_EXPORT HDFinternalObject : public HDFobject { private : HDFinternalObject *_previousbrother; diff --git a/src/HDFPersist/HDFobject.cc b/src/HDFPersist/HDFobject.cc index 5adb8aafe..e4f751a9b 100644 --- a/src/HDFPersist/HDFobject.cc +++ b/src/HDFPersist/HDFobject.cc @@ -28,8 +28,9 @@ extern "C" { #include "hdfi.h" -#include } + +#include //#include "utilities.h" using namespace std; diff --git a/src/HDFPersist/HDFobject.hxx b/src/HDFPersist/HDFobject.hxx index 3c829822a..22b6a3b69 100644 --- a/src/HDFPersist/HDFobject.hxx +++ b/src/HDFPersist/HDFobject.hxx @@ -33,7 +33,7 @@ extern "C" } #include -class HDF_EXPORT HDFobject { +class HDFPERSIST_EXPORT HDFobject { protected : char *_name; hdf_idt _id; diff --git a/src/Launcher/BatchLight_BatchManager.cxx b/src/Launcher/BatchLight_BatchManager.cxx index 37def271e..291f6f613 100644 --- a/src/Launcher/BatchLight_BatchManager.cxx +++ b/src/Launcher/BatchLight_BatchManager.cxx @@ -29,7 +29,12 @@ #include #include #include -#include +#ifdef WNT +# include +# include +#else +# include +#endif #include "BatchLight_Job.hxx" #include "BatchLight_BatchManager.hxx" #include "Batch_Date.hxx" @@ -252,7 +257,7 @@ namespace BatchLight { mkstemp(temp); #else char aPID[80]; - itoa(getpid(), aPID, 10); + itoa( _getpid(), aPID, 10); strcat(temp, aPID); #endif diff --git a/src/Launcher/BatchLight_BatchManager_PBS.cxx b/src/Launcher/BatchLight_BatchManager_PBS.cxx index eec063a02..cd02df56b 100644 --- a/src/Launcher/BatchLight_BatchManager_PBS.cxx +++ b/src/Launcher/BatchLight_BatchManager_PBS.cxx @@ -34,6 +34,10 @@ #include #include +#ifdef WNT +# include +#endif + using namespace std; namespace BatchLight { @@ -274,7 +278,12 @@ namespace BatchLight { tempOutputFile << "fi" << endl; tempOutputFile.flush(); tempOutputFile.close(); - chmod(TmpFileName.c_str(), 0x1ED); +#ifdef WNT + _chmod +#else + chmod +#endif + (TmpFileName.c_str(), 0x1ED); SCRUTE(TmpFileName.c_str()) ; string command; @@ -358,7 +367,12 @@ namespace BatchLight { tempOutputFile << _mpiImpl->halt(); tempOutputFile.flush(); tempOutputFile.close(); - chmod(TmpFileName.c_str(), 0x1ED); +#ifdef WNT + _chmod +#else + chmod +#endif + (TmpFileName.c_str(), 0x1ED); SCRUTE(TmpFileName.c_str()) ; string command; diff --git a/src/Launcher/BatchLight_BatchManager_SLURM.cxx b/src/Launcher/BatchLight_BatchManager_SLURM.cxx index d184ca6bb..ac91a28ba 100644 --- a/src/Launcher/BatchLight_BatchManager_SLURM.cxx +++ b/src/Launcher/BatchLight_BatchManager_SLURM.cxx @@ -34,6 +34,10 @@ #include #include +#ifdef WNT +# include +#endif + using namespace std; namespace BatchLight { @@ -185,7 +189,13 @@ namespace BatchLight { tempOutputFile << "fi" << endl ; tempOutputFile.flush(); tempOutputFile.close(); - chmod(TmpFileName.c_str(), 0x1ED); +#ifdef WNT + _chmod +#else + chmod +#endif + (TmpFileName.c_str(), 0x1ED); + SCRUTE(TmpFileName.c_str()) ; string command; diff --git a/src/Launcher/BatchLight_Job.cxx b/src/Launcher/BatchLight_Job.cxx index 1980054a9..bb9cfb3cf 100644 --- a/src/Launcher/BatchLight_Job.cxx +++ b/src/Launcher/BatchLight_Job.cxx @@ -132,7 +132,7 @@ Job::check() { rtn = false; } std::string end_mem_value = mem_value.substr(mem_value.length()-2); - if (end_mem_value != "gb" and end_mem_value != "mb") { + if (end_mem_value != "gb" && end_mem_value != "mb") { mem_info = "Error on definition, type is bad ! " + mem_value; rtn = false; } diff --git a/src/Launcher/SALOME_Launcher.cxx b/src/Launcher/SALOME_Launcher.cxx index a507c010d..6d13865ea 100644 --- a/src/Launcher/SALOME_Launcher.cxx +++ b/src/Launcher/SALOME_Launcher.cxx @@ -25,6 +25,8 @@ #include #ifndef WNT #include +#else +#include #endif #include #include "Utils_CorbaException.hxx" @@ -105,7 +107,12 @@ void SALOME_Launcher::Shutdown() //============================================================================= CORBA::Long SALOME_Launcher::getPID() { - return (CORBA::Long)getpid(); + return (CORBA::Long) +#ifdef WNT + _getpid(); +#else + getpid(); +#endif } //============================================================================= @@ -167,7 +174,7 @@ CORBA::Long SALOME_Launcher::submitSalomeJob( const char * fileToExecute , * \param params : Constraints for the choice of the batch cluster */ //============================================================================= -char* SALOME_Launcher::querySalomeJob( const CORBA::Long jobId, +char* SALOME_Launcher::querySalomeJob( /*const */CORBA::Long jobId, const Engines::MachineParameters& params) { string status; @@ -199,7 +206,7 @@ char* SALOME_Launcher::querySalomeJob( const CORBA::Long jobId, * \param params : Constraints for the choice of the batch cluster */ //============================================================================= -void SALOME_Launcher::deleteSalomeJob( const CORBA::Long jobId, +void SALOME_Launcher::deleteSalomeJob( CORBA::Long jobId, const Engines::MachineParameters& params) { try{ @@ -230,7 +237,7 @@ void SALOME_Launcher::deleteSalomeJob( const CORBA::Long jobId, */ //============================================================================= void SALOME_Launcher::getResultSalomeJob( const char *directory, - const CORBA::Long jobId, + CORBA::Long jobId, const Engines::MachineParameters& params) { try{ diff --git a/src/Launcher/SALOME_Launcher.hxx b/src/Launcher/SALOME_Launcher.hxx index 4bc5d65ce..8627fae23 100644 --- a/src/Launcher/SALOME_Launcher.hxx +++ b/src/Launcher/SALOME_Launcher.hxx @@ -29,18 +29,14 @@ class SALOME_NamingService; -#if defined LAUNCHER_EXPORTS -#if defined WIN32 -#define LAUNCHER_EXPORT __declspec( dllexport ) +#ifdef WNT +# ifdef LAUNCHER_EXPORTS +# define LAUNCHER_EXPORT __declspec( dllexport ) +# else +# define LAUNCHER_EXPORT __declspec( dllimport ) +# endif #else -#define LAUNCHER_EXPORT -#endif -#else -#if defined WNT -#define LAUNCHER_EXPORT __declspec( dllimport ) -#else -#define LAUNCHER_EXPORT -#endif +# define LAUNCHER_EXPORT #endif class LAUNCHER_EXPORT SALOME_Launcher: @@ -58,9 +54,9 @@ public: const Engines::BatchParameters& batch_params, const Engines::MachineParameters& params); - char* querySalomeJob( const CORBA::Long jobId, const Engines::MachineParameters& params); - void deleteSalomeJob( const CORBA::Long jobId, const Engines::MachineParameters& params); - void getResultSalomeJob( const char * directory, const CORBA::Long jobId, const Engines::MachineParameters& params ); + char* querySalomeJob( CORBA::Long jobId, const Engines::MachineParameters& params); + void deleteSalomeJob( CORBA::Long jobId, const Engines::MachineParameters& params); + void getResultSalomeJob( const char * directory, CORBA::Long jobId, const Engines::MachineParameters& params ); void Shutdown(); diff --git a/src/Launcher/SALOME_LauncherServer.cxx b/src/Launcher/SALOME_LauncherServer.cxx index 5913d0ffb..59429b690 100644 --- a/src/Launcher/SALOME_LauncherServer.cxx +++ b/src/Launcher/SALOME_LauncherServer.cxx @@ -24,6 +24,13 @@ #include #include +#ifdef WNT +# include +# define getPID _getpid +#else +# define getPID getpid +#endif + using namespace std; void AttachDebugger() diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 5e3760e22..d82d8592d 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -31,6 +31,11 @@ #include #include +#ifdef WIN32 +# include +#endif + + using namespace std; #include "utilities.h" @@ -620,7 +625,12 @@ SALOME_ModuleCatalogImpl::GetComponentInfo(const char *name) CORBA::Long SALOME_ModuleCatalogImpl::getPID() { - return (CORBA::Long)getpid(); + return +#ifndef WIN32 + (CORBA::Long)getpid(); +#else + (CORBA::Long)_getpid(); +#endif } void SALOME_ModuleCatalogImpl::ShutdownWithExit() diff --git a/src/NamingService/SALOME_NamingService.hxx b/src/NamingService/SALOME_NamingService.hxx index 57e53ab75..35f174766 100644 --- a/src/NamingService/SALOME_NamingService.hxx +++ b/src/NamingService/SALOME_NamingService.hxx @@ -39,18 +39,14 @@ #include "Utils_Mutex.hxx" #include "ServiceUnreachable.hxx" -#if defined NAMINGSERVICE_EXPORTS -#if defined WIN32 -#define NAMINGSERVICE_EXPORT __declspec( dllexport ) +#ifdef WIN32 +# ifdef NAMINGSERVICE_EXPORTS +# define NAMINGSERVICE_EXPORT __declspec( dllexport ) +# else +# define NAMINGSERVICE_EXPORT __declspec( dllimport ) +# endif #else -#define NAMINGSERVICE_EXPORT -#endif -#else -#if defined WNT -#define NAMINGSERVICE_EXPORT __declspec( dllimport ) -#else -#define NAMINGSERVICE_EXPORT -#endif +# define NAMINGSERVICE_EXPORT #endif class NAMINGSERVICE_EXPORT SALOME_NamingService diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index ea88da8f8..5c7ca50e5 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -639,12 +639,22 @@ SALOME_ResourcesManager::BuildCommandToLaunchLocalContainer if(wdir == "$TEMPDIR") { // a new temporary directory is requested - char dir[]="/tmp/salomeXXXXXX"; + /*char dir[]="/tmp/salomeXXXXXX"; char* mdir=mkdtemp(dir); if(mdir==NULL) std::cerr << "Problem in mkdtemp " << dir << " " << mdir << std::endl; else command="cd "+std::string(dir)+";"; + */ + string dir = OpUtil_Dir::GetTmpDir(); +#ifdef WNT + if ( dir.length() > 1 && dir[1] == ':') + command = dir.substr( 0, 2 ) + ";"; + command += "cd "+ dir +";"; +#else + command = "cd "+ dir +";"; +#endif + } else { diff --git a/src/ResourcesManager/SALOME_ResourcesManager.hxx b/src/ResourcesManager/SALOME_ResourcesManager.hxx index 23c7bd647..f680df68d 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.hxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.hxx @@ -31,18 +31,14 @@ #include #include -#if defined RESOURCESMANAGER_EXPORTS -#if defined WIN32 -#define RESOURCESMANAGER_EXPORT __declspec( dllexport ) +#ifdef WIN32 +# ifdef RESOURCESMANAGER_EXPORTS +# define RESOURCESMANAGER_EXPORT __declspec( dllexport ) +# else +# define RESOURCESMANAGER_EXPORT __declspec( dllimport ) +# endif #else -#define RESOURCESMANAGER_EXPORT -#endif -#else -#if defined WNT -#define RESOURCESMANAGER_EXPORT __declspec( dllimport ) -#else -#define RESOURCESMANAGER_EXPORT -#endif +# define RESOURCESMANAGER_EXPORT #endif // --- WARNING --- diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx index 6c25a767a..0bcb49844 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx @@ -79,7 +79,8 @@ char* SALOMEDS_GenericAttribute_i::Type() { SALOMEDS::Locker lock; if (_impl) { - return CORBA::string_dup(SALOMEDSImpl_GenericAttribute::Impl_GetType(_impl)); + string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(_impl); + return CORBA::string_dup(type.c_str()); } return ""; @@ -89,7 +90,8 @@ char* SALOMEDS_GenericAttribute_i::GetClassType() { SALOMEDS::Locker lock; if (_impl) { - return CORBA::string_dup(SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl)); + string class_type = SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl); + return CORBA::string_dup(class_type.c_str()); } return ""; diff --git a/src/SALOMEDSImpl/Makefile.am b/src/SALOMEDSImpl/Makefile.am index 4ca4e58ab..de0b5f12e 100644 --- a/src/SALOMEDSImpl/Makefile.am +++ b/src/SALOMEDSImpl/Makefile.am @@ -74,6 +74,7 @@ salomeinclude_HEADERS= \ SALOMEDSImpl_Study.hxx \ SALOMEDSImpl_StudyManager.hxx \ SALOMEDSImpl_ChildNodeIterator.hxx \ + SALOMEDSImpl_Defines.hxx \ SALOMEDSImpl_IParameters.hxx \ SALOMEDSImpl_TMPFile.hxx @@ -189,6 +190,7 @@ libSalomeDSImpl_la_SOURCES =\ SALOMEDSImpl_Callback.hxx \ SALOMEDSImpl_ChildIterator.hxx \ SALOMEDSImpl_ChildNodeIterator.hxx \ + SALOMEDSImpl_Defines.hxx \ SALOMEDSImpl_Driver.hxx \ SALOMEDSImpl_GenericAttribute.hxx \ SALOMEDSImpl_SComponent.hxx \ diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx index e76570dd1..45be60a9d 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx @@ -23,22 +23,20 @@ #include "SALOMEDSImpl_AttributeComment.hxx" -#ifndef WNT using namespace std; -#endif //======================================================================= //function : GetID //purpose : //======================================================================= -const std::string& SALOMEDSImpl_AttributeComment::GetID () +const string& SALOMEDSImpl_AttributeComment::GetID () { - static std::string CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9"); + static string CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9"); return CommentID; } SALOMEDSImpl_AttributeComment* SALOMEDSImpl_AttributeComment::Set (const DF_Label& L, - const std::string& Val) + const string& Val) { SALOMEDSImpl_AttributeComment* A = NULL; if (!(A=(SALOMEDSImpl_AttributeComment*)L.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) { @@ -73,7 +71,7 @@ void SALOMEDSImpl_AttributeComment::SetValue (const string& S) //function : ID //purpose : //======================================================================= -const std::string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); } +const string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); } //======================================================================= //function : NewEmpty diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx index 8f6e361b5..71f7e25e5 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx @@ -24,37 +24,39 @@ #ifndef _SALOMEDSImpl_AttributeComment_HeaderFile #define _SALOMEDSImpl_AttributeComment_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" -#include "SALOMEDSImpl_GenericAttribute.hxx" #include -class SALOMEDSImpl_AttributeComment : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeComment : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; + static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeComment() :SALOMEDSImpl_GenericAttribute("AttributeComment") {} + SALOMEDSImpl_AttributeComment() :SALOMEDSImpl_GenericAttribute("AttributeComment") {} -Standard_EXPORT static SALOMEDSImpl_AttributeComment* Set(const DF_Label& L, const std::string& Val); -Standard_EXPORT void SetValue (const std::string& S); -Standard_EXPORT std::string Value() const { return myString; } + static SALOMEDSImpl_AttributeComment* Set(const DF_Label& L, const std::string& Val); + void SetValue (const std::string& S); + std::string Value() const { return myString; } -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeComment() {} + ~SALOMEDSImpl_AttributeComment() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx index 9fa1122e7..d1b464bfd 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx @@ -24,31 +24,33 @@ #ifndef _SALOMEDSImpl_AttributeDrawable_HeaderFile #define _SALOMEDSImpl_AttributeDrawable_HeaderFile +#include "SALOMEDSImpl_GenericAttribute.hxx" +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" -#include #include "DF_Label.hxx" -#include "SALOMEDSImpl_GenericAttribute.hxx" - -class SALOMEDSImpl_AttributeDrawable : public SALOMEDSImpl_GenericAttribute +#include + +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeDrawable : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } -Standard_EXPORT virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeDrawable* Set(const DF_Label& label,const int value) ; - -Standard_EXPORT void SetDrawable(const int theValue); -Standard_EXPORT int IsDrawable() const { return myValue; } -Standard_EXPORT SALOMEDSImpl_AttributeDrawable(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeDrawable() {} + virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } + virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeDrawable* Set(const DF_Label& label,const int value) ; + + void SetDrawable(const int theValue); + int IsDrawable() const { return myValue; } + SALOMEDSImpl_AttributeDrawable(); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeDrawable() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx index 8b80e3b39..c22b57ab6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx @@ -24,32 +24,34 @@ #ifndef _SALOMEDSImpl_AttributeExpandable_HeaderFile #define _SALOMEDSImpl_AttributeExpandable_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" -#include -#include "SALOMEDSImpl_GenericAttribute.hxx" +#include -class SALOMEDSImpl_AttributeExpandable : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeExpandable : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } -Standard_EXPORT virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeExpandable* Set(const DF_Label& label,const int value) ; -Standard_EXPORT SALOMEDSImpl_AttributeExpandable(); -Standard_EXPORT void SetExpandable(const int value); -Standard_EXPORT int IsExpandable() const { return myValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeExpandable() {} + virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } + virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeExpandable* Set(const DF_Label& label,const int value) ; + SALOMEDSImpl_AttributeExpandable(); + void SetExpandable(const int value); + int IsExpandable() const { return myValue; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeExpandable() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx index 2222717bd..ee5649952 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx @@ -21,32 +21,35 @@ #ifndef _SALOMEDSImpl_AttributeExternalFileDef_HeaderFile #define _SALOMEDSImpl_AttributeExternalFileDef_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include -#include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeExternalFileDef : public SALOMEDSImpl_GenericAttribute + +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeExternalFileDef : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeExternalFileDef* Set(const DF_Label& label, - const std::string& Name); -Standard_EXPORT SALOMEDSImpl_AttributeExternalFileDef(); -Standard_EXPORT void SetValue(const std::string& value); -Standard_EXPORT std::string Value() const { return myString; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeExternalFileDef() {} - -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeExternalFileDef* Set(const DF_Label& label, + const std::string& Name); + SALOMEDSImpl_AttributeExternalFileDef(); + void SetValue(const std::string& value); + std::string Value() const { return myString; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeExternalFileDef() {} + + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx index a4d61fe96..d5396bd02 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx @@ -21,32 +21,35 @@ #ifndef _SALOMEDSImpl_AttributeFileType_HeaderFile #define _SALOMEDSImpl_AttributeFileType_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include -#include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeFileType : public SALOMEDSImpl_GenericAttribute + +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeFileType : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeFileType* Set(const DF_Label& label, - const std::string& Name) ; -Standard_EXPORT SALOMEDSImpl_AttributeFileType(); -Standard_EXPORT void SetValue(const std::string& value); -Standard_EXPORT std::string Value() const { return myString; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeFileType() {} - -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeFileType* Set(const DF_Label& label, + const std::string& Name) ; + SALOMEDSImpl_AttributeFileType(); + void SetValue(const std::string& value); + std::string Value() const { return myString; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeFileType() {} + + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.hxx index 773df8891..353c1ed21 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.hxx @@ -24,38 +24,37 @@ #ifndef SALOMEDSImpl_AttributeFlags_HeaderFile #define SALOMEDSImpl_AttributeFlags_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" -#include "SALOMEDSImpl_GenericAttribute.hxx" + /* - Class : SALOMEDSImpl_AttributeFlags - Description : This class is intended for storing different object attributes that - have only two states (0 and 1). +Class : SALOMEDSImpl_AttributeFlags +Description : This class is intended for storing different object attributes that +have only two states (0 and 1). */ -#ifndef WNT -class Standard_EXPORT SALOMEDSImpl_AttributeFlags : public SALOMEDSImpl_GenericAttribute -#else -class SALOMEDSImpl_AttributeFlags : public SALOMEDSImpl_GenericAttribute -#endif +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeFlags : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeFlags* Set(const DF_Label&, const int theValue ); - - SALOMEDSImpl_AttributeFlags(); -Standard_EXPORT virtual ~SALOMEDSImpl_AttributeFlags(); - -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore( DF_Attribute* with ); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste( DF_Attribute* into); -Standard_EXPORT void Set( const int ); -Standard_EXPORT int Get() const; + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeFlags* Set(const DF_Label&, const int theValue ); + + SALOMEDSImpl_AttributeFlags(); + virtual ~SALOMEDSImpl_AttributeFlags(); + + const std::string& ID() const; + void Restore( DF_Attribute* with ); + DF_Attribute* NewEmpty() const; + void Paste( DF_Attribute* into); + void Set( const int ); + int Get() const; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.hxx index 69801875a..5358b81ec 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.hxx @@ -24,42 +24,39 @@ #ifndef SALOMEDSImpl_AttributeGraphic_HeaderFile #define SALOMEDSImpl_AttributeGraphic_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" -#include "SALOMEDSImpl_GenericAttribute.hxx" - #include /* - Class : SALOMEDSImpl_AttributeGraphic - Description : This class is intended for storing information about - graphic representation of objects in dirrent views +Class : SALOMEDSImpl_AttributeGraphic +Description : This class is intended for storing information about +graphic representation of objects in dirrent views */ -#ifndef WNT -class Standard_EXPORT SALOMEDSImpl_AttributeGraphic : public SALOMEDSImpl_GenericAttribute -#else -class SALOMEDSImpl_AttributeGraphic : public SALOMEDSImpl_GenericAttribute -#endif +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeGraphic : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT SALOMEDSImpl_AttributeGraphic(); -Standard_EXPORT ~SALOMEDSImpl_AttributeGraphic(); - -Standard_EXPORT static const std::string& GetID() ; + SALOMEDSImpl_AttributeGraphic(); + ~SALOMEDSImpl_AttributeGraphic(); + + static const std::string& GetID() ; + + void SetVisibility( const int, const bool ); + bool GetVisibility( const int ); + const std::string& ID() const; + void Restore( DF_Attribute* theWith ); + DF_Attribute* NewEmpty() const; + void Paste( DF_Attribute* theInto); -Standard_EXPORT void SetVisibility( const int, const bool ); -Standard_EXPORT bool GetVisibility( const int ); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore( DF_Attribute* theWith ); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste( DF_Attribute* theInto); + void SetVisibility( const std::map& ); -Standard_EXPORT void SetVisibility( const std::map& ); + const std::map& GetVisibility(); -Standard_EXPORT const std::map& GetVisibility(); - private: std::map myVisibility; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.hxx index eb0be83c5..8f061a033 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.hxx @@ -24,30 +24,32 @@ #ifndef _SALOMEDSImpl_AttributeIOR_HeaderFile #define _SALOMEDSImpl_AttributeIOR_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeIOR : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeIOR : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeIOR* Set(const DF_Label& label, - const std::string& IOR); -Standard_EXPORT SALOMEDSImpl_AttributeIOR(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void SetValue(const std::string& theValue); -Standard_EXPORT std::string Value() const ; -Standard_EXPORT void Restore(DF_Attribute* with); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeIOR() {} + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeIOR* Set(const DF_Label& label, + const std::string& IOR); + SALOMEDSImpl_AttributeIOR(); + const std::string& ID() const; + void SetValue(const std::string& theValue); + std::string Value() const ; + void Restore(DF_Attribute* with); + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeIOR() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx index ea1058ff9..4731fc01b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx @@ -23,11 +23,8 @@ #include "SALOMEDSImpl_AttributeInteger.hxx" -#ifndef WNT -using namespace std; -#endif - #include +using namespace std; //======================================================================= //function : GetID @@ -114,7 +111,7 @@ void SALOMEDSImpl_AttributeInteger::Paste (DF_Attribute* Into) //======================================================================= string SALOMEDSImpl_AttributeInteger::Save() { - char buffer[128]; + char* buffer = new char[128]; sprintf(buffer, "%d", myValue); return string(buffer); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx index 94751adfa..a2a2e5753 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx @@ -24,31 +24,32 @@ #ifndef _SALOMEDSImpl_AttributeInteger_HeaderFile #define _SALOMEDSImpl_AttributeInteger_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeInteger : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeInteger : public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT static const std::string& GetID() ; - -Standard_EXPORT SALOMEDSImpl_AttributeInteger():SALOMEDSImpl_GenericAttribute("AttributeInteger") {} -Standard_EXPORT static SALOMEDSImpl_AttributeInteger* Set (const DF_Label& L, int Val); -Standard_EXPORT void SetValue(const int theVal); -Standard_EXPORT int Value() const; -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string& theValue); - -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeInteger() {} + static const std::string& GetID() ; + + SALOMEDSImpl_AttributeInteger():SALOMEDSImpl_GenericAttribute("AttributeInteger") {} + static SALOMEDSImpl_AttributeInteger* Set (const DF_Label& L, int Val); + void SetValue(const int theVal); + int Value() const; + virtual std::string Save(); + virtual void Load(const std::string& theValue); + + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeInteger() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.hxx index 2654146b4..d44c06009 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.hxx @@ -24,31 +24,33 @@ #ifndef _SALOMEDSImpl_AttributeLocalID_HeaderFile #define _SALOMEDSImpl_AttributeLocalID_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeLocalID : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeLocalID : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string& theValue); - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeLocalID* Set(const DF_Label& label,const int value) ; -Standard_EXPORT void SetValue(const int value); -Standard_EXPORT int Value() const { return myValue; } -Standard_EXPORT SALOMEDSImpl_AttributeLocalID(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute*); -Standard_EXPORT ~SALOMEDSImpl_AttributeLocalID() {} + virtual std::string Save(); + virtual void Load(const std::string& theValue); + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeLocalID* Set(const DF_Label& label,const int value) ; + void SetValue(const int value); + int Value() const { return myValue; } + SALOMEDSImpl_AttributeLocalID(); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute*); + ~SALOMEDSImpl_AttributeLocalID() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx index 2bb858a68..2e5d0e961 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx @@ -24,35 +24,37 @@ #ifndef _SALOMEDSImpl_AttributeName_HeaderFile #define _SALOMEDSImpl_AttributeName_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeName : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeName : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; + static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeName():SALOMEDSImpl_GenericAttribute("AttributeName") {} -Standard_EXPORT static SALOMEDSImpl_AttributeName* Set (const DF_Label& L, const std::string& Val); -Standard_EXPORT void SetValue(const std::string& theVal); -Standard_EXPORT std::string Value() const { return myString; } + SALOMEDSImpl_AttributeName():SALOMEDSImpl_GenericAttribute("AttributeName") {} + static SALOMEDSImpl_AttributeName* Set (const DF_Label& L, const std::string& Val); + void SetValue(const std::string& theVal); + std::string Value() const { return myString; } -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeName() {} + ~SALOMEDSImpl_AttributeName() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx index 8efd33901..b86d496ec 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx @@ -24,31 +24,33 @@ #ifndef _SALOMEDSImpl_AttributeOpened_HeaderFile #define _SALOMEDSImpl_AttributeOpened_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeOpened : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeOpened : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } -Standard_EXPORT virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeOpened* Set(const DF_Label& label,const int value) ; -Standard_EXPORT SALOMEDSImpl_AttributeOpened(); -Standard_EXPORT void SetOpened(const int value); -Standard_EXPORT int IsOpened() const { return myValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeOpened() {} + virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } + virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeOpened* Set(const DF_Label& label,const int value) ; + SALOMEDSImpl_AttributeOpened(); + void SetOpened(const int value); + int IsOpened() const { return myValue; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeOpened() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx index ecbc14ec2..e3ee0940f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx @@ -24,6 +24,7 @@ #ifndef _SALOMEDSImpl_AttributeParameter_HeaderFile #define _SALOMEDSImpl_AttributeParameter_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" @@ -35,15 +36,16 @@ enum Parameter_Types {PT_INTEGER, PT_REAL, PT_BOOLEAN, PT_STRING, PT_REALARRAY, PT_INTARRAY, PT_STRARRAY}; /*! - Class: SALOMEDSImpl_AttributeParameter - Description : AttributeParameter is a universal container of basic types +Class: SALOMEDSImpl_AttributeParameter +Description : AttributeParameter is a universal container of basic types */ -class SALOMEDSImpl_AttributeParameter : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeParameter : + public SALOMEDSImpl_GenericAttribute { private: - + std::map _ints; std::map _reals; std::map _strings; @@ -53,54 +55,54 @@ private: std::map< std::string, std::vector > _strarrays; public: - Standard_EXPORT static const std::string& GetID() ; + static const std::string& GetID() ; + + SALOMEDSImpl_AttributeParameter():SALOMEDSImpl_GenericAttribute("AttributeParameter") {} + static SALOMEDSImpl_AttributeParameter* Set (const DF_Label& L); + + + void SetInt(const std::string& theID, const int& theValue); + int GetInt(const std::string& theID); + + void SetReal(const std::string& theID, const double& theValue); + double GetReal(const std::string& theID); + + void SetString(const std::string& theID, const std::string& theValue); + std::string GetString(const std::string& theID); - Standard_EXPORT SALOMEDSImpl_AttributeParameter():SALOMEDSImpl_GenericAttribute("AttributeParameter") {} - Standard_EXPORT static SALOMEDSImpl_AttributeParameter* Set (const DF_Label& L); + void SetBool(const std::string& theID, const bool& theValue); + bool GetBool(const std::string& theID); + void SetRealArray(const std::string& theID, const std::vector& theArray); + std::vector GetRealArray(const std::string& theID); - Standard_EXPORT void SetInt(const std::string& theID, const int& theValue); - Standard_EXPORT int GetInt(const std::string& theID); + void SetIntArray(const std::string& theID, const std::vector& theArray); + std::vector GetIntArray(const std::string& theID); - Standard_EXPORT void SetReal(const std::string& theID, const double& theValue); - Standard_EXPORT double GetReal(const std::string& theID); + void SetStrArray(const std::string& theID, const std::vector& theArray); + std::vector GetStrArray(const std::string& theID); - Standard_EXPORT void SetString(const std::string& theID, const std::string& theValue); - Standard_EXPORT std::string GetString(const std::string& theID); - - Standard_EXPORT void SetBool(const std::string& theID, const bool& theValue); - Standard_EXPORT bool GetBool(const std::string& theID); - - Standard_EXPORT void SetRealArray(const std::string& theID, const std::vector& theArray); - Standard_EXPORT std::vector GetRealArray(const std::string& theID); - - Standard_EXPORT void SetIntArray(const std::string& theID, const std::vector& theArray); - Standard_EXPORT std::vector GetIntArray(const std::string& theID); + bool IsSet(const std::string& theID, const Parameter_Types theType); - Standard_EXPORT void SetStrArray(const std::string& theID, const std::vector& theArray); - Standard_EXPORT std::vector GetStrArray(const std::string& theID); + bool RemoveID(const std::string& theID, const Parameter_Types theType); - Standard_EXPORT bool IsSet(const std::string& theID, const Parameter_Types theType); - - Standard_EXPORT bool RemoveID(const std::string& theID, const Parameter_Types theType); + SALOMEDSImpl_AttributeParameter* GetFather(); + bool HasFather(); + bool IsRoot(); - Standard_EXPORT SALOMEDSImpl_AttributeParameter* GetFather(); - Standard_EXPORT bool HasFather(); - Standard_EXPORT bool IsRoot(); + std::vector GetIDs(const Parameter_Types theType); - Standard_EXPORT std::vector GetIDs(const Parameter_Types theType); + void Clear(); - Standard_EXPORT void Clear(); + virtual std::string Save(); + virtual void Load(const std::string& theValue); - Standard_EXPORT virtual std::string Save(); - Standard_EXPORT virtual void Load(const std::string& theValue); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); - Standard_EXPORT const std::string& ID() const; - Standard_EXPORT void Restore(DF_Attribute* with) ; - Standard_EXPORT DF_Attribute* NewEmpty() const; - Standard_EXPORT void Paste(DF_Attribute* into); - - Standard_EXPORT ~SALOMEDSImpl_AttributeParameter() {} + ~SALOMEDSImpl_AttributeParameter() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx index fa95a619f..256da73eb 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx @@ -24,33 +24,35 @@ #ifndef _SALOMEDSImpl_AttributePersistentRef_HeaderFile #define _SALOMEDSImpl_AttributePersistentRef_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributePersistentRef : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributePersistentRef : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributePersistentRef* Set(const DF_Label& label, - const std::string& value) ; -Standard_EXPORT SALOMEDSImpl_AttributePersistentRef(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void SetValue(const std::string& value); -Standard_EXPORT std::string Value() const { return myString; } -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributePersistentRef() {} + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributePersistentRef* Set(const DF_Label& label, + const std::string& value) ; + SALOMEDSImpl_AttributePersistentRef(); + const std::string& ID() const; + void SetValue(const std::string& value); + std::string Value() const { return myString; } + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributePersistentRef() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx index ac0fcbd33..feb9e67d9 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx @@ -24,33 +24,35 @@ #ifndef _SALOMEDSImpl_AttributePixMap_HeaderFile #define _SALOMEDSImpl_AttributePixMap_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributePixMap : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributePixMap : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributePixMap* Set(const DF_Label& label, - const std::string& string) ; -Standard_EXPORT SALOMEDSImpl_AttributePixMap(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void SetPixMap(const std::string& value); -Standard_EXPORT std::string GetPixMap() const { return myString; } -Standard_EXPORT bool HasPixMap() const { return (myString != "None"); } -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributePixMap() {} + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributePixMap* Set(const DF_Label& label, + const std::string& string) ; + SALOMEDSImpl_AttributePixMap(); + const std::string& ID() const; + void SetPixMap(const std::string& value); + std::string GetPixMap() const { return myString; } + bool HasPixMap() const { return (myString != "None"); } + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributePixMap() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.hxx index bda55e4fa..b9c105e50 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.hxx @@ -24,6 +24,7 @@ #ifndef _SALOMEDSImpl_AttributePythonObject_HeaderFile #define _SALOMEDSImpl_AttributePythonObject_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include @@ -33,30 +34,31 @@ #undef GetObject #endif -class SALOMEDSImpl_AttributePythonObject : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributePythonObject : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributePythonObject* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributePythonObject(); -Standard_EXPORT void SetObject(const std::string& theSequence, const bool theScript) ; -Standard_EXPORT std::string GetObject() const; -Standard_EXPORT bool IsScript() const; -Standard_EXPORT int GetLength() const; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributePythonObject() {} + virtual std::string Save(); + virtual void Load(const std::string&); + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributePythonObject* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributePythonObject(); + void SetObject(const std::string& theSequence, const bool theScript) ; + std::string GetObject() const; + bool IsScript() const; + int GetLength() const; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributePythonObject() {} private: -std::string mySequence; -bool myIsScript; + std::string mySequence; + bool myIsScript; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx index 488f3bfe8..93bdba112 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx @@ -24,31 +24,33 @@ #ifndef _SALOMEDSImpl_AttributeReal_HeaderFile #define _SALOMEDSImpl_AttributeReal_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeReal : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeReal : + public SALOMEDSImpl_GenericAttribute { private: double myValue; public: -Standard_EXPORT static const std::string& GetID() ; + static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeReal():SALOMEDSImpl_GenericAttribute("AttributeReal") {} -Standard_EXPORT static SALOMEDSImpl_AttributeReal* Set (const DF_Label& L, const double& Val); -Standard_EXPORT void SetValue(const double& theVal); -Standard_EXPORT double Value() const { return myValue; } -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string& theValue); + SALOMEDSImpl_AttributeReal():SALOMEDSImpl_GenericAttribute("AttributeReal") {} + static SALOMEDSImpl_AttributeReal* Set (const DF_Label& L, const double& Val); + void SetValue(const double& theVal); + double Value() const { return myValue; } + virtual std::string Save(); + virtual void Load(const std::string& theValue); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeReal() {} + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeReal() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.hxx index 4c69dee7b..f1e78ad64 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.hxx @@ -24,33 +24,35 @@ #ifndef _SALOMEDSImpl_AttributeReference_HeaderFile #define _SALOMEDSImpl_AttributeReference_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeReference : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeReference : + public SALOMEDSImpl_GenericAttribute { private: - DF_Label myLabel; + DF_Label myLabel; public: -Standard_EXPORT static const std::string& GetID() ; + static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeReference():SALOMEDSImpl_GenericAttribute("AttributeReference") {} -Standard_EXPORT static SALOMEDSImpl_AttributeReference* Set(const DF_Label& theLabel, const DF_Label& theRefLabel); -Standard_EXPORT void Set(const DF_Label& theLabel); -Standard_EXPORT DF_Label Get() const { return myLabel; } -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string& theValue); + SALOMEDSImpl_AttributeReference():SALOMEDSImpl_GenericAttribute("AttributeReference") {} + static SALOMEDSImpl_AttributeReference* Set(const DF_Label& theLabel, const DF_Label& theRefLabel); + void Set(const DF_Label& theLabel); + DF_Label Get() const { return myLabel; } + virtual std::string Save(); + virtual void Load(const std::string& theValue); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeReference() {} + ~SALOMEDSImpl_AttributeReference() {} }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx index dfdc71871..56d5fa750 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx @@ -24,31 +24,33 @@ #ifndef _SALOMEDSImpl_AttributeSelectable_HeaderFile #define _SALOMEDSImpl_AttributeSelectable_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeSelectable : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeSelectable : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } -Standard_EXPORT virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeSelectable* Set(const DF_Label& label,const int value) ; -Standard_EXPORT SALOMEDSImpl_AttributeSelectable(); -Standard_EXPORT void SetSelectable(const int value); -Standard_EXPORT int IsSelectable() const { return myValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeSelectable() {} + virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } + virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeSelectable* Set(const DF_Label& label,const int value) ; + SALOMEDSImpl_AttributeSelectable(); + void SetSelectable(const int value); + int IsSelectable() const { return myValue; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeSelectable() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.hxx index f1f935b4d..7c0f5cb83 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.hxx @@ -24,38 +24,40 @@ #ifndef _SALOMEDSImpl_AttributeSequenceOfInteger_HeaderFile #define _SALOMEDSImpl_AttributeSequenceOfInteger_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeSequenceOfInteger : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeSequenceOfInteger : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeSequenceOfInteger* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeSequenceOfInteger(); -Standard_EXPORT void Assign(const std::vector& other) ; -Standard_EXPORT void ChangeValue(const int Index,const int Value) ; -Standard_EXPORT void Add(const int value) ; -Standard_EXPORT int Value(const int Index) ; -Standard_EXPORT void Remove(const int Index) ; -Standard_EXPORT int Length() ; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeSequenceOfInteger() {} -Standard_EXPORT const std::vector& Array() { return myValue; } + virtual std::string Save(); + virtual void Load(const std::string&); + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeSequenceOfInteger* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeSequenceOfInteger(); + void Assign(const std::vector& other) ; + void ChangeValue(const int Index,const int Value) ; + void Add(const int value) ; + int Value(const int Index) ; + void Remove(const int Index) ; + int Length() ; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeSequenceOfInteger() {} + const std::vector& Array() { return myValue; } private: -std::vector myValue; + std::vector myValue; }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.hxx index 10ebdf846..91f0a7c68 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.hxx @@ -24,6 +24,7 @@ #ifndef _SALOMEDSImpl_AttributeSequenceOfReal_HeaderFile #define _SALOMEDSImpl_AttributeSequenceOfReal_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include @@ -31,32 +32,33 @@ #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeSequenceOfReal : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeSequenceOfReal : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeSequenceOfReal* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeSequenceOfReal(); -Standard_EXPORT void Assign(const std::vector& other) ; -Standard_EXPORT void ChangeValue(const int Index,const double& Value) ; -Standard_EXPORT void Add(const double& Value) ; -Standard_EXPORT double Value(const int Index) ; -Standard_EXPORT void Remove(const int Index) ; -Standard_EXPORT int Length() ; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeSequenceOfReal() {} -Standard_EXPORT const std::vector& Array() { return myValue; } + virtual std::string Save(); + virtual void Load(const std::string&); + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeSequenceOfReal* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeSequenceOfReal(); + void Assign(const std::vector& other) ; + void ChangeValue(const int Index,const double& Value) ; + void Add(const double& Value) ; + double Value(const int Index) ; + void Remove(const int Index) ; + int Length() ; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeSequenceOfReal() {} + const std::vector& Array() { return myValue; } private: -std::vector myValue; + std::vector myValue; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.hxx index 2f7bb8587..c1228321b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.hxx @@ -24,36 +24,38 @@ #ifndef _SALOMEDSImpl_AttributeString_HeaderFile #define _SALOMEDSImpl_AttributeString_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeString : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeString : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; + static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeString() :SALOMEDSImpl_GenericAttribute("AttributeString") {} + SALOMEDSImpl_AttributeString() :SALOMEDSImpl_GenericAttribute("AttributeString") {} -Standard_EXPORT static SALOMEDSImpl_AttributeString* Set(const DF_Label& L, const std::string& Val); -Standard_EXPORT void SetValue (const std::string& S); -Standard_EXPORT std::string Value() const { return myString; } + static SALOMEDSImpl_AttributeString* Set(const DF_Label& L, const std::string& Val); + void SetValue (const std::string& S); + std::string Value() const { return myString; } -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeString() {} + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeString() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.hxx index c520bce61..3cf59dfb3 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.hxx @@ -24,77 +24,78 @@ #ifndef _SALOMEDSImpl_AttributeStudyProperties_HeaderFile #define _SALOMEDSImpl_AttributeStudyProperties_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT SALOMEDSImpl_AttributeStudyProperties(); -Standard_EXPORT ~SALOMEDSImpl_AttributeStudyProperties() {} + SALOMEDSImpl_AttributeStudyProperties(); + ~SALOMEDSImpl_AttributeStudyProperties() {} -Standard_EXPORT static const std::string& GetID(); -Standard_EXPORT const std::string& ID() const; + static const std::string& GetID(); + const std::string& ID() const; -Standard_EXPORT static SALOMEDSImpl_AttributeStudyProperties* Set(const DF_Label& label); + static SALOMEDSImpl_AttributeStudyProperties* Set(const DF_Label& label); -Standard_EXPORT void Init(); + void Init(); -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); + virtual std::string Save(); + virtual void Load(const std::string&); -Standard_EXPORT void SetModification(const std::string& theUserName, - const int theMinute, - const int theHour, - const int theDay, - const int theMonth, - const int theYear); -Standard_EXPORT void GetModifications(std::vector& theUserNames, - std::vector& theMinutes, - std::vector& theHours, - std::vector& theDays, - std::vector& theMonths, - std::vector& theYears) const; + void SetModification(const std::string& theUserName, + const int theMinute, + const int theHour, + const int theDay, + const int theMonth, + const int theYear); + void GetModifications(std::vector& theUserNames, + std::vector& theMinutes, + std::vector& theHours, + std::vector& theDays, + std::vector& theMonths, + std::vector& theYears) const; -Standard_EXPORT std::string GetCreatorName() const; -Standard_EXPORT bool GetCreationDate(int& theMinute, - int& theHour, - int& theDay, - int& theMonth, - int& theYear) const; + std::string GetCreatorName() const; + bool GetCreationDate(int& theMinute, + int& theHour, + int& theDay, + int& theMonth, + int& theYear) const; -Standard_EXPORT void ChangeCreatorName(const std::string& theUserName); + void ChangeCreatorName(const std::string& theUserName); -Standard_EXPORT void SetCreationMode(const int theMode); -Standard_EXPORT int GetCreationMode() const; + void SetCreationMode(const int theMode); + int GetCreationMode() const; -Standard_EXPORT void SetModified(const int theModified); -Standard_EXPORT bool IsModified() const; -Standard_EXPORT int GetModified() const; + void SetModified(const int theModified); + bool IsModified() const; + int GetModified() const; -Standard_EXPORT void SetLocked(const bool theLocked); -Standard_EXPORT bool IsLocked() const; -Standard_EXPORT bool IsLockChanged(const bool theErase); + void SetLocked(const bool theLocked); + bool IsLocked() const; + bool IsLockChanged(const bool theErase); -Standard_EXPORT void Restore(DF_Attribute* with); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + void Restore(DF_Attribute* with); + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); private: -std::vector myUserName; -std::vector myMinute; -std::vector myHour; -std::vector myDay; -std::vector myMonth; -std::vector myYear; -int myMode; -int myModified; -bool myLocked; -bool myLockChanged; + std::vector myUserName; + std::vector myMinute; + std::vector myHour; + std::vector myDay; + std::vector myMonth; + std::vector myYear; + int myMode; + int myModified; + bool myLocked; + bool myLockChanged; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx index 84434df7b..b89383513 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx @@ -11,6 +11,7 @@ #ifndef _SALOMEDSImpl_AttributeTableOfInteger_HeaderFile #define _SALOMEDSImpl_AttributeTableOfInteger_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" @@ -20,58 +21,59 @@ #include -class SALOMEDSImpl_AttributeTableOfInteger : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfInteger : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeTableOfInteger* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeTableOfInteger(); -Standard_EXPORT void SetNbColumns(const int theNbColumns); -Standard_EXPORT void SetTitle(const std::string& theTitle) ; -Standard_EXPORT std::string GetTitle() const; -Standard_EXPORT void SetRowData(const int theRow,const std::vector& theData) ; -Standard_EXPORT std::vector GetRowData(const int theRow) ; -Standard_EXPORT void SetRowTitle(const int theRow,const std::string& theTitle) ; -Standard_EXPORT void SetRowUnit(const int theRow,const std::string& theUnit) ; -Standard_EXPORT std::string GetRowUnit(const int theRow) const; -Standard_EXPORT void SetRowUnits(const std::vector& theUnits) ; -Standard_EXPORT std::vector GetRowUnits(); -Standard_EXPORT void SetRowTitles(const std::vector& theTitles) ; -Standard_EXPORT std::vector GetRowTitles(); -Standard_EXPORT std::string GetRowTitle(const int theRow) const; -Standard_EXPORT void SetColumnData(const int theColumn,const std::vector& theData) ; -Standard_EXPORT std::vector GetColumnData(const int theColumn) ; -Standard_EXPORT void SetColumnTitle(const int theColumn,const std::string& theTitle) ; -Standard_EXPORT std::string GetColumnTitle(const int theColumn) const; -Standard_EXPORT void SetColumnTitles(const std::vector& theTitles); -Standard_EXPORT std::vector GetColumnTitles(); -Standard_EXPORT int GetNbRows() const; -Standard_EXPORT int GetNbColumns() const; + virtual std::string Save(); + virtual void Load(const std::string&); + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeTableOfInteger* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeTableOfInteger(); + void SetNbColumns(const int theNbColumns); + void SetTitle(const std::string& theTitle) ; + std::string GetTitle() const; + void SetRowData(const int theRow,const std::vector& theData) ; + std::vector GetRowData(const int theRow) ; + void SetRowTitle(const int theRow,const std::string& theTitle) ; + void SetRowUnit(const int theRow,const std::string& theUnit) ; + std::string GetRowUnit(const int theRow) const; + void SetRowUnits(const std::vector& theUnits) ; + std::vector GetRowUnits(); + void SetRowTitles(const std::vector& theTitles) ; + std::vector GetRowTitles(); + std::string GetRowTitle(const int theRow) const; + void SetColumnData(const int theColumn,const std::vector& theData) ; + std::vector GetColumnData(const int theColumn) ; + void SetColumnTitle(const int theColumn,const std::string& theTitle) ; + std::string GetColumnTitle(const int theColumn) const; + void SetColumnTitles(const std::vector& theTitles); + std::vector GetColumnTitles(); + int GetNbRows() const; + int GetNbColumns() const; -Standard_EXPORT void PutValue(const int theValue,const int theRow,const int theColumn) ; -Standard_EXPORT bool HasValue(const int theRow,const int theColumn) ; -Standard_EXPORT int GetValue(const int theRow,const int theColumn) ; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + void PutValue(const int theValue,const int theRow,const int theColumn) ; + bool HasValue(const int theRow,const int theColumn) ; + int GetValue(const int theRow,const int theColumn) ; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT std::vector GetSetRowIndices(const int theRow); -Standard_EXPORT std::vector GetSetColumnIndices(const int theColumn); + std::vector GetSetRowIndices(const int theRow); + std::vector GetSetColumnIndices(const int theColumn); -Standard_EXPORT ~SALOMEDSImpl_AttributeTableOfInteger() {} + ~SALOMEDSImpl_AttributeTableOfInteger() {} private: -std::map myTable; -std::string myTitle; -std::vector myRows; -std::vector myCols; -int myNbRows; -int myNbColumns; + std::map myTable; + std::string myTitle; + std::vector myRows; + std::vector myCols; + int myNbRows; + int myNbColumns; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx index 3dea7567d..672a26e5b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx @@ -11,6 +11,7 @@ #ifndef _SALOMEDSImpl_AttributeTableOfReal_HeaderFile #define _SALOMEDSImpl_AttributeTableOfReal_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" @@ -19,57 +20,58 @@ #include #include -class SALOMEDSImpl_AttributeTableOfReal : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfReal : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeTableOfReal* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeTableOfReal(); -Standard_EXPORT void SetNbColumns(const int theNbColumns); -Standard_EXPORT void SetTitle(const std::string& theTitle) ; -Standard_EXPORT std::string GetTitle() const; -Standard_EXPORT void SetRowData(const int theRow,const std::vector& theData) ; -Standard_EXPORT std::vector GetRowData(const int theRow) ; -Standard_EXPORT void SetRowTitle(const int theRow,const std::string& theTitle) ; -Standard_EXPORT void SetRowUnit(const int theRow,const std::string& theUnit) ; -Standard_EXPORT std::string GetRowUnit(const int theRow) const; -Standard_EXPORT void SetRowUnits(const std::vector& theUnits) ; -Standard_EXPORT std::vector GetRowUnits(); -Standard_EXPORT void SetRowTitles(const std::vector& theTitles) ; -Standard_EXPORT std::vector GetRowTitles(); -Standard_EXPORT std::string GetRowTitle(const int theRow) const; -Standard_EXPORT void SetColumnData(const int theColumn,const std::vector& theData) ; -Standard_EXPORT std::vector GetColumnData(const int theColumn) ; -Standard_EXPORT void SetColumnTitle(const int theColumn,const std::string& theTitle) ; -Standard_EXPORT void SetColumnTitles(const std::vector& theTitles); -Standard_EXPORT std::vector GetColumnTitles(); -Standard_EXPORT std::string GetColumnTitle(const int theColumn) const; -Standard_EXPORT int GetNbRows() const; -Standard_EXPORT int GetNbColumns() const; + virtual std::string Save(); + virtual void Load(const std::string&); + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeTableOfReal* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeTableOfReal(); + void SetNbColumns(const int theNbColumns); + void SetTitle(const std::string& theTitle) ; + std::string GetTitle() const; + void SetRowData(const int theRow,const std::vector& theData) ; + std::vector GetRowData(const int theRow) ; + void SetRowTitle(const int theRow,const std::string& theTitle) ; + void SetRowUnit(const int theRow,const std::string& theUnit) ; + std::string GetRowUnit(const int theRow) const; + void SetRowUnits(const std::vector& theUnits) ; + std::vector GetRowUnits(); + void SetRowTitles(const std::vector& theTitles) ; + std::vector GetRowTitles(); + std::string GetRowTitle(const int theRow) const; + void SetColumnData(const int theColumn,const std::vector& theData) ; + std::vector GetColumnData(const int theColumn) ; + void SetColumnTitle(const int theColumn,const std::string& theTitle) ; + void SetColumnTitles(const std::vector& theTitles); + std::vector GetColumnTitles(); + std::string GetColumnTitle(const int theColumn) const; + int GetNbRows() const; + int GetNbColumns() const; -Standard_EXPORT void PutValue(const double& theValue,const int theRow,const int theColumn) ; -Standard_EXPORT bool HasValue(const int theRow,const int theColumn) ; -Standard_EXPORT double GetValue(const int theRow,const int theColumn) ; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + void PutValue(const double& theValue,const int theRow,const int theColumn) ; + bool HasValue(const int theRow,const int theColumn) ; + double GetValue(const int theRow,const int theColumn) ; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT std::vector GetSetRowIndices(const int theRow); -Standard_EXPORT std::vector GetSetColumnIndices(const int theColumn); + std::vector GetSetRowIndices(const int theRow); + std::vector GetSetColumnIndices(const int theColumn); -Standard_EXPORT ~SALOMEDSImpl_AttributeTableOfReal() {} + ~SALOMEDSImpl_AttributeTableOfReal() {} private: -std::map myTable; -std::string myTitle; -std::vector myRows; -std::vector myCols; -int myNbRows; -int myNbColumns; + std::map myTable; + std::string myTitle; + std::vector myRows; + std::vector myCols; + int myNbRows; + int myNbColumns; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx index 0a4da3185..f30caa8a3 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx @@ -11,6 +11,7 @@ #ifndef _SALOMEDSImpl_AttributeTableOfString_HeaderFile #define _SALOMEDSImpl_AttributeTableOfString_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Label.hxx" #include "DF_Attribute.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" @@ -19,58 +20,59 @@ #include #include -class SALOMEDSImpl_AttributeTableOfString : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfString : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeTableOfString* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeTableOfString(); -Standard_EXPORT void SetNbColumns(const int theNbColumns); -Standard_EXPORT void SetTitle(const std::string& theTitle) ; -Standard_EXPORT std::string GetTitle() const; -Standard_EXPORT void SetRowData(const int theRow,const std::vector& theData) ; -Standard_EXPORT std::vector GetRowData(const int theRow) ; -Standard_EXPORT void SetRowTitle(const int theRow,const std::string& theTitle) ; -Standard_EXPORT void SetRowUnit(const int theRow,const std::string& theUnit) ; -Standard_EXPORT std::string GetRowUnit(const int theRow) const; -Standard_EXPORT void SetRowUnits(const std::vector& theUnits) ; -Standard_EXPORT std::vector GetRowUnits(); -Standard_EXPORT void SetRowTitles(const std::vector& theTitles) ; -Standard_EXPORT std::vector GetRowTitles(); -Standard_EXPORT std::string GetRowTitle(const int theRow) const; -Standard_EXPORT void SetColumnData(const int theColumn,const std::vector& theData) ; -Standard_EXPORT std::vector GetColumnData(const int theColumn) ; -Standard_EXPORT void SetColumnTitle(const int theColumn,const std::string& theTitle) ; -Standard_EXPORT std::string GetColumnTitle(const int theColumn) const; -Standard_EXPORT void SetColumnTitles(const std::vector& theTitles); -Standard_EXPORT std::vector GetColumnTitles(); -Standard_EXPORT int GetNbRows() const; -Standard_EXPORT int GetNbColumns() const; + virtual std::string Save(); + virtual void Load(const std::string&); + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeTableOfString* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeTableOfString(); + void SetNbColumns(const int theNbColumns); + void SetTitle(const std::string& theTitle) ; + std::string GetTitle() const; + void SetRowData(const int theRow,const std::vector& theData) ; + std::vector GetRowData(const int theRow) ; + void SetRowTitle(const int theRow,const std::string& theTitle) ; + void SetRowUnit(const int theRow,const std::string& theUnit) ; + std::string GetRowUnit(const int theRow) const; + void SetRowUnits(const std::vector& theUnits) ; + std::vector GetRowUnits(); + void SetRowTitles(const std::vector& theTitles) ; + std::vector GetRowTitles(); + std::string GetRowTitle(const int theRow) const; + void SetColumnData(const int theColumn,const std::vector& theData) ; + std::vector GetColumnData(const int theColumn) ; + void SetColumnTitle(const int theColumn,const std::string& theTitle) ; + std::string GetColumnTitle(const int theColumn) const; + void SetColumnTitles(const std::vector& theTitles); + std::vector GetColumnTitles(); + int GetNbRows() const; + int GetNbColumns() const; -Standard_EXPORT void PutValue(const std::string& theValue,const int theRow,const int theColumn) ; -Standard_EXPORT bool HasValue(const int theRow,const int theColumn) ; -Standard_EXPORT std::string GetValue(const int theRow,const int theColumn) ; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + void PutValue(const std::string& theValue,const int theRow,const int theColumn) ; + bool HasValue(const int theRow,const int theColumn) ; + std::string GetValue(const int theRow,const int theColumn) ; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT std::vector GetSetRowIndices(const int theRow); -Standard_EXPORT std::vector GetSetColumnIndices(const int theColumn); + std::vector GetSetRowIndices(const int theRow); + std::vector GetSetColumnIndices(const int theColumn); -Standard_EXPORT ~SALOMEDSImpl_AttributeTableOfString() {} + ~SALOMEDSImpl_AttributeTableOfString() {} private: -std::map myTable; -std::string myTitle; -std::vector myRows; -std::vector myCols; -int myNbRows; -int myNbColumns; + std::map myTable; + std::string myTitle; + std::vector myRows; + std::vector myCols; + int myNbRows; + int myNbColumns; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx index 5c4bb4f71..ea3663759 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx @@ -24,33 +24,35 @@ #ifndef _SALOMEDSImpl_AttributeTarget_HeaderFile #define _SALOMEDSImpl_AttributeTarget_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include "SALOMEDSImpl_GenericAttribute.hxx" #include "SALOMEDSImpl_SObject.hxx" -class SALOMEDSImpl_AttributeTarget : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTarget : + public SALOMEDSImpl_GenericAttribute { private: -std::string myRelation; -std::vector myVariables; + std::string myRelation; + std::vector myVariables; public: -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeTarget* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeTarget(); -Standard_EXPORT void Add(const SALOMEDSImpl_SObject& theSO); -Standard_EXPORT std::vector Get(); -Standard_EXPORT void Remove(const SALOMEDSImpl_SObject& theSO); -Standard_EXPORT std::string GetRelation() { return myRelation; } -Standard_EXPORT void SetRelation(const std::string& theRelation); -Standard_EXPORT std::vector& GetVariables() { return myVariables; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeTarget() {} + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeTarget* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeTarget(); + void Add(const SALOMEDSImpl_SObject& theSO); + std::vector Get(); + void Remove(const SALOMEDSImpl_SObject& theSO); + std::string GetRelation() { return myRelation; } + void SetRelation(const std::string& theRelation); + std::vector& GetVariables() { return myVariables; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeTarget() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx index a0e9f50d7..477cda6c1 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx @@ -24,30 +24,32 @@ #ifndef _SALOMEDSImpl_AttributeTextColor_HeaderFile #define _SALOMEDSImpl_AttributeTextColor_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeTextColor : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTextColor : + public SALOMEDSImpl_GenericAttribute { private: std::vector myValue; public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeTextColor(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void SetTextColor(const double& R, const double& G, const double& B); -Standard_EXPORT std::vector TextColor(); -Standard_EXPORT void ChangeArray(const std::vector& newArray); -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste( DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeTextColor() {} + virtual std::string Save(); + virtual void Load(const std::string&); + static const std::string& GetID() ; + SALOMEDSImpl_AttributeTextColor(); + const std::string& ID() const; + void SetTextColor(const double& R, const double& G, const double& B); + std::vector TextColor(); + void ChangeArray(const std::vector& newArray); + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste( DF_Attribute* into); + ~SALOMEDSImpl_AttributeTextColor() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx index d17e7f29c..017af2394 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx @@ -24,6 +24,7 @@ #ifndef _SALOMEDSImpl_AttributeTextHighlightColor_HeaderFile #define _SALOMEDSImpl_AttributeTextHighlightColor_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include @@ -31,24 +32,25 @@ #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeTextHighlightColor : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTextHighlightColor : + public SALOMEDSImpl_GenericAttribute { private: std::vector myValue; public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeTextHighlightColor(); -Standard_EXPORT void SetTextHighlightColor(const double& R, const double& G, const double& B); -Standard_EXPORT std::vector TextHighlightColor(); -Standard_EXPORT void ChangeArray(const std::vector& newArray); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeTextHighlightColor() {} + virtual std::string Save(); + virtual void Load(const std::string&); + static const std::string& GetID() ; + SALOMEDSImpl_AttributeTextHighlightColor(); + void SetTextHighlightColor(const double& R, const double& G, const double& B); + std::vector TextHighlightColor(); + void ChangeArray(const std::vector& newArray); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeTextHighlightColor() {} }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.hxx index 88d6a6b0d..8555b1bb0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.hxx @@ -24,71 +24,73 @@ #ifndef _SALOMEDSImpl_AttributeTreeNode_HeaderFile #define _SALOMEDSImpl_AttributeTreeNode_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeTreeNode : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTreeNode : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT const static std::string& GetDefaultTreeID(); -Standard_EXPORT static SALOMEDSImpl_AttributeTreeNode* Set(const DF_Label& L, const std::string& ID); - -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode(); -Standard_EXPORT void SetFather(const SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT void SetPrevious(const SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT void SetNext(const SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT void SetFirst(const SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT void SetTreeID(const std::string& value); - -Standard_EXPORT bool Append(SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT bool Prepend(SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT bool Remove(); -Standard_EXPORT bool InsertBefore(SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT bool InsertAfter(SALOMEDSImpl_AttributeTreeNode* value); - -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetFather() const { return myFather; } -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetPrevious() const { return myPrevious; } -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetNext() const { return myNext; } -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetFirst() const { return myFirst; } - -Standard_EXPORT bool HasFather() { return (myFather); } -Standard_EXPORT bool HasPrevious() { return (myPrevious); } -Standard_EXPORT bool HasNext() {return (myNext); } -Standard_EXPORT bool HasFirst() { return (myFirst); } -Standard_EXPORT const std::string& GetTreeID() { return ID(); } -Standard_EXPORT int Depth() const; -Standard_EXPORT bool IsRoot() const ; -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* Root() const; -Standard_EXPORT bool IsAscendant (const SALOMEDSImpl_AttributeTreeNode* ofTN) const; -Standard_EXPORT bool IsDescendant(const SALOMEDSImpl_AttributeTreeNode* value) const; -Standard_EXPORT bool IsFather(const SALOMEDSImpl_AttributeTreeNode* value) const; -Standard_EXPORT bool IsChild(const SALOMEDSImpl_AttributeTreeNode* value) const; - -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT virtual std::string Type(); - -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT ~SALOMEDSImpl_AttributeTreeNode() {;} - -Standard_EXPORT virtual void AfterAddition(); -Standard_EXPORT virtual void BeforeForget(); + const static std::string& GetDefaultTreeID(); + static SALOMEDSImpl_AttributeTreeNode* Set(const DF_Label& L, const std::string& ID); + + SALOMEDSImpl_AttributeTreeNode(); + void SetFather(const SALOMEDSImpl_AttributeTreeNode* value); + void SetPrevious(const SALOMEDSImpl_AttributeTreeNode* value); + void SetNext(const SALOMEDSImpl_AttributeTreeNode* value); + void SetFirst(const SALOMEDSImpl_AttributeTreeNode* value); + void SetTreeID(const std::string& value); + + bool Append(SALOMEDSImpl_AttributeTreeNode* value); + bool Prepend(SALOMEDSImpl_AttributeTreeNode* value); + bool Remove(); + bool InsertBefore(SALOMEDSImpl_AttributeTreeNode* value); + bool InsertAfter(SALOMEDSImpl_AttributeTreeNode* value); + + SALOMEDSImpl_AttributeTreeNode* GetFather() const { return myFather; } + SALOMEDSImpl_AttributeTreeNode* GetPrevious() const { return myPrevious; } + SALOMEDSImpl_AttributeTreeNode* GetNext() const { return myNext; } + SALOMEDSImpl_AttributeTreeNode* GetFirst() const { return myFirst; } + + bool HasFather() { return (myFather); } + bool HasPrevious() { return (myPrevious); } + bool HasNext() {return (myNext); } + bool HasFirst() { return (myFirst); } + const std::string& GetTreeID() { return ID(); } + int Depth() const; + bool IsRoot() const ; + SALOMEDSImpl_AttributeTreeNode* Root() const; + bool IsAscendant (const SALOMEDSImpl_AttributeTreeNode* ofTN) const; + bool IsDescendant(const SALOMEDSImpl_AttributeTreeNode* value) const; + bool IsFather(const SALOMEDSImpl_AttributeTreeNode* value) const; + bool IsChild(const SALOMEDSImpl_AttributeTreeNode* value) const; + + virtual std::string Save(); + virtual void Load(const std::string&); + virtual std::string Type(); + + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + void Paste(DF_Attribute* into); + DF_Attribute* NewEmpty() const; + ~SALOMEDSImpl_AttributeTreeNode() {;} + + virtual void AfterAddition(); + virtual void BeforeForget(); private: -std::string myTreeID; -SALOMEDSImpl_AttributeTreeNode* myFather; -SALOMEDSImpl_AttributeTreeNode* myPrevious; -SALOMEDSImpl_AttributeTreeNode* myNext; -SALOMEDSImpl_AttributeTreeNode* myFirst; + std::string myTreeID; + SALOMEDSImpl_AttributeTreeNode* myFather; + SALOMEDSImpl_AttributeTreeNode* myPrevious; + SALOMEDSImpl_AttributeTreeNode* myNext; + SALOMEDSImpl_AttributeTreeNode* myFirst; -friend class SALOMEDSImpl_ChildNodeIterator; + friend class SALOMEDSImpl_ChildNodeIterator; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.hxx index 8d3ab95ac..5bf9b27c3 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.hxx @@ -24,36 +24,38 @@ #ifndef _SALOMEDSImpl_AttributeUserID_HeaderFile #define _SALOMEDSImpl_AttributeUserID_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeUserID : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeUserID : + public SALOMEDSImpl_GenericAttribute { private: -std::string myID; + std::string myID; public: -SALOMEDSImpl_AttributeUserID():SALOMEDSImpl_GenericAttribute("AttributeUserID") {} -static SALOMEDSImpl_AttributeUserID* Set (const DF_Label& L, const std::string& ID); -static const std::string& DefaultID() -{ - static std::string SALOMEDSImpl_DefaultUserAttributeID ("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); - return SALOMEDSImpl_DefaultUserAttributeID; -} - -Standard_EXPORT const std::string& Value() const { return ID(); } -Standard_EXPORT void SetValue(const std::string& value); - -Standard_EXPORT virtual std::string Type(); - -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeUserID() {} + SALOMEDSImpl_AttributeUserID():SALOMEDSImpl_GenericAttribute("AttributeUserID") {} + static SALOMEDSImpl_AttributeUserID* Set (const DF_Label& L, const std::string& ID); + static const std::string& DefaultID() + { + static std::string SALOMEDSImpl_DefaultUserAttributeID ("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); + return SALOMEDSImpl_DefaultUserAttributeID; + } + + const std::string& Value() const { return ID(); } + void SetValue(const std::string& value); + + virtual std::string Type(); + + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeUserID() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx index ff366e786..895bae5ea 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx @@ -24,15 +24,7 @@ #ifndef __SALOMEDSIMPL_ATTRIBUTES__H__ #define __SALOMEDSIMPL_ATTRIBUTES__H__ -#ifdef WNT -# ifdef SALOMEDSIMPL_EXPORTS -# define SALOMEDSIMPL_EXPORT __declspec( dllexport ) -# else -# define SALOMEDSIMPL_EXPORT __declspec( dllimport ) -# endif -#else -# define SALOMEDSIMPL_EXPORT -#endif +#include "SALOMEDSImpl_Defines.hxx" #include class SALOMEDSIMPL_EXPORT LockProtection diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx index 313d1d305..22ae44b6c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx @@ -24,30 +24,30 @@ #ifndef __SALOMEDSIMPL_CALLBACK_H__ #define __SALOMEDSIMPL_CALLBACK_H__ - +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_UseCaseBuilder.hxx" -class SALOMEDSImpl_Callback +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Callback { private: SALOMEDSImpl_UseCaseBuilder* _builder; public: - SALOMEDSImpl_Callback(SALOMEDSImpl_UseCaseBuilder* builder) - { - _builder = builder; - } + SALOMEDSImpl_Callback(SALOMEDSImpl_UseCaseBuilder* builder) + { + _builder = builder; + } - virtual void OnAddSObject(const SALOMEDSImpl_SObject& theObject) - { - if(_builder != NULL && theObject) _builder->Append(theObject); - } + virtual void OnAddSObject(const SALOMEDSImpl_SObject& theObject) + { + if(_builder != NULL && theObject) _builder->Append(theObject); + } - virtual void OnRemoveSObject(const SALOMEDSImpl_SObject& theObject) - { - if(_builder != NULL && theObject) _builder->Remove(theObject); - } + virtual void OnRemoveSObject(const SALOMEDSImpl_SObject& theObject) + { + if(_builder != NULL && theObject) _builder->Remove(theObject); + } }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx index e3c50b9b0..9e3d5b568 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx @@ -24,12 +24,12 @@ #ifndef __SALOMEDSImpl_CHILDITERATOR_H__ #define __SALOMEDSImpl_CHILDITERATOR_H__ - +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_SObject.hxx" #include "DF_ChildIterator.hxx" #include "DF_Label.hxx" -class SALOMEDSImpl_ChildIterator +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_ChildIterator { private: DF_ChildIterator _it; @@ -37,20 +37,20 @@ private: public: - Standard_EXPORT SALOMEDSImpl_ChildIterator() {} - Standard_EXPORT SALOMEDSImpl_ChildIterator(const SALOMEDSImpl_SObject& theSO); - Standard_EXPORT SALOMEDSImpl_ChildIterator(const DF_Label& theLabel); - Standard_EXPORT ~SALOMEDSImpl_ChildIterator() {}; - - Standard_EXPORT virtual void Init(); - Standard_EXPORT virtual void Init(const DF_Label& theLabel); - Standard_EXPORT virtual void InitEx(bool theAllLevels); - Standard_EXPORT virtual void InitEx(const DF_Label& theLabel, bool theAllLevels); - Standard_EXPORT virtual bool More(); - Standard_EXPORT virtual void Next(); - Standard_EXPORT virtual SALOMEDSImpl_SObject Value(); - Standard_EXPORT virtual DF_Label Label(); - - Standard_EXPORT SALOMEDSImpl_ChildIterator* GetPersistentCopy() const; + SALOMEDSImpl_ChildIterator() {} + SALOMEDSImpl_ChildIterator(const SALOMEDSImpl_SObject& theSO); + SALOMEDSImpl_ChildIterator(const DF_Label& theLabel); + ~SALOMEDSImpl_ChildIterator() {}; + + virtual void Init(); + virtual void Init(const DF_Label& theLabel); + virtual void InitEx(bool theAllLevels); + virtual void InitEx(const DF_Label& theLabel, bool theAllLevels); + virtual bool More(); + virtual void Next(); + virtual SALOMEDSImpl_SObject Value(); + virtual DF_Label Label(); + + SALOMEDSImpl_ChildIterator* GetPersistentCopy() const; }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.hxx index 21651a4e7..452a60f84 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.hxx @@ -21,27 +21,28 @@ #ifndef _SALOMEDSImpl_ChildNodeIterator_HeaderFile #define _SALOMEDSImpl_ChildNodeIterator_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_AttributeTreeNode.hxx" -class SALOMEDSImpl_ChildNodeIterator +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_ChildNodeIterator { public: -Standard_EXPORT SALOMEDSImpl_ChildNodeIterator(); -Standard_EXPORT SALOMEDSImpl_ChildNodeIterator(const SALOMEDSImpl_AttributeTreeNode* aTreeNode, - const bool allLevels = false); -Standard_EXPORT void Initialize(const SALOMEDSImpl_AttributeTreeNode* aTreeNode, - const bool allLevels = false) ; -Standard_EXPORT bool More() const { return (myNode); } -Standard_EXPORT void Next() ; -Standard_EXPORT void NextBrother() ; -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* Value() const { return myNode; } + SALOMEDSImpl_ChildNodeIterator(); + SALOMEDSImpl_ChildNodeIterator(const SALOMEDSImpl_AttributeTreeNode* aTreeNode, + const bool allLevels = false); + void Initialize(const SALOMEDSImpl_AttributeTreeNode* aTreeNode, + const bool allLevels = false) ; + bool More() const { return (myNode); } + void Next() ; + void NextBrother() ; + SALOMEDSImpl_AttributeTreeNode* Value() const { return myNode; } private: -SALOMEDSImpl_AttributeTreeNode* myNode; -int myFirstLevel; + SALOMEDSImpl_AttributeTreeNode* myNode; + int myFirstLevel; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx new file mode 100755 index 000000000..ddd99cda6 --- /dev/null +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx @@ -0,0 +1,39 @@ +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOMEDSImpl_Defines.hxx +// Author : Alexander A. BORODIN +// Module : KERNEL + +#ifndef _SALOMEDSImpl_Defines_HXX_ +#define _SALOMEDSImpl_Defines_HXX_ + +#ifdef WIN32 +# if defined SALOMEDSIMPL_EXPORTS +# define SALOMEDSIMPL_EXPORT __declspec( dllexport ) +# else +# define SALOMEDSIMPL_EXPORT __declspec( dllimport ) +# endif +#else +# define SALOMEDSIMPL_EXPORT +#endif + +#endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx index 88fac75f5..ff2c0475d 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx @@ -20,78 +20,79 @@ #ifndef __SALOMEDSIMPL_DRIVER_H__ #define __SALOMEDSIMPL_DRIVER_H__ +#include "SALOMEDSImpl_Defines.hxx" #include #include #include #include -class SALOMEDSImpl_Driver +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Driver { public: virtual std::string GetIOR() = 0; virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent, - const std::string& theURL, - long& theStreamLength, - bool isMultiFile) = 0; + const std::string& theURL, + long& theStreamLength, + bool isMultiFile) = 0; virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent, - const std::string& theURL, - long& theStreamLength, - bool isMultiFile) = 0; - + const std::string& theURL, + long& theStreamLength, + bool isMultiFile) = 0; + virtual bool Load(const SALOMEDSImpl_SComponent& theComponent, - const unsigned char* theStream, - const long theStreamLength, - const std::string& theURL, - bool isMultiFile) = 0; + const unsigned char* theStream, + const long theStreamLength, + const std::string& theURL, + bool isMultiFile) = 0; virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent, - const unsigned char* theStream, - const long theStreamLength, - const std::string& theURL, - bool isMultiFile) = 0; + const unsigned char* theStream, + const long theStreamLength, + const std::string& theURL, + bool isMultiFile) = 0; virtual void Close(const SALOMEDSImpl_SComponent& theComponent) = 0; - + virtual std::string ComponentDataType() = 0; virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject, - const std::string& IORString, - bool isMultiFile, - bool isASCII) = 0; + const std::string& IORString, + bool isMultiFile, + bool isASCII) = 0; virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject, - const std::string& aLocalPersistentID, - bool isMultiFile, - bool isASCII) = 0; + const std::string& aLocalPersistentID, + bool isMultiFile, + bool isASCII) = 0; virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject) = 0; virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject, - int& theObjectID, - long& theStreamLength) = 0; - + int& theObjectID, + long& theStreamLength) = 0; + virtual bool CanPaste(const std::string& theComponentName, int theObjectID) = 0; virtual std::string PasteInto(const unsigned char* theStream, - const long theStreamLength, - int theObjectID, - const SALOMEDSImpl_SObject& theObject) = 0; + const long theStreamLength, + int theObjectID, + const SALOMEDSImpl_SObject& theObject) = 0; virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy, - bool isPublished, - bool& isValidScript, - long& theStreamLength) = 0; + bool isPublished, + bool& isValidScript, + long& theStreamLength) = 0; }; class SALOMEDSImpl_DriverFactory { public: - + virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType) = 0; virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR) = 0; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx index 168645bb0..37caac3fb 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx @@ -28,16 +28,22 @@ using namespace std; -char* SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr) +string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr) { SALOMEDSImpl_GenericAttribute* ga = dynamic_cast(theAttr); - return (char*)ga->Type().c_str(); + if (ga) + return ga->Type(); + + return ""; } -char* SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr) +string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr) { SALOMEDSImpl_GenericAttribute* ga = dynamic_cast(theAttr); - return (char*)ga->GetClassType().c_str(); + if (ga) + return ga->GetClassType(); + + return ""; } void SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(DF_Attribute* theAttr) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx index 345e0fd64..0fcdb3f5c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx @@ -24,13 +24,15 @@ #ifndef _GENERICIMPL_ATTRIBUTE_HXX_ #define _GENERICIMPL_ATTRIBUTE_HXX_ +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Label.hxx" #include "DF_Attribute.hxx" #include #include "SALOMEDSImpl_SObject.hxx" -class SALOMEDSImpl_GenericAttribute: public DF_Attribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_GenericAttribute: + public DF_Attribute { protected: @@ -38,19 +40,19 @@ protected: public: -Standard_EXPORT SALOMEDSImpl_GenericAttribute(const std::string& theType) -:_type(theType) -{} + SALOMEDSImpl_GenericAttribute(const std::string& theType) + :_type(theType) + {} -Standard_EXPORT virtual std::string Type(); -Standard_EXPORT virtual void CheckLocked(); -Standard_EXPORT std::string GetClassType() { return _type; } -Standard_EXPORT SALOMEDSImpl_SObject GetSObject(); -Standard_EXPORT void SetModifyFlag(); + virtual std::string Type(); + virtual void CheckLocked(); + std::string GetClassType() { return _type; } + SALOMEDSImpl_SObject GetSObject(); + void SetModifyFlag(); -Standard_EXPORT static char* Impl_GetType(DF_Attribute* theAttr); -Standard_EXPORT static char* Impl_GetClassType(DF_Attribute* theAttr); -Standard_EXPORT static void Impl_CheckLocked(DF_Attribute* theAttr); + static std::string Impl_GetType(DF_Attribute* theAttr); + static std::string Impl_GetClassType(DF_Attribute* theAttr); + static void Impl_CheckLocked(DF_Attribute* theAttr); }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx index a197b28ef..69d8beaef 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx @@ -19,6 +19,7 @@ #ifndef SALOMEDSImpl_IParameters_H #define SALOMEDSImpl_IParameters_H +#include "SALOMEDSImpl_Defines.hxx" #include #include #include @@ -27,9 +28,9 @@ #include "SALOMEDSImpl_Study.hxx" /*! - Class which an interface to store the parameters of the objects +Class which an interface to store the parameters of the objects */ -class Standard_EXPORT SALOMEDSImpl_IParameters +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_IParameters { public: SALOMEDSImpl_IParameters(SALOMEDSImpl_AttributeParameter* ap); @@ -37,109 +38,109 @@ public: virtual ~SALOMEDSImpl_IParameters(); /*! - Appends a string value to a named list. - Returns a number of the added value. - Note: the name of the list MUST be unique - */ + Appends a string value to a named list. + Returns a number of the added value. + Note: the name of the list MUST be unique + */ virtual int append(const std::string& listName, const std::string& value); /*! - Returns a number elements in the list - */ + Returns a number elements in the list + */ virtual int nbValues(const std::string& listName); /*! - Returns a list of values in the list - */ + Returns a list of values in the list + */ virtual std::vector getValues(const std::string& listName); /*! - Returns a value with given %index, where %index is in range [0:nbValues-1] - */ + Returns a value with given %index, where %index is in range [0:nbValues-1] + */ virtual std::string getValue(const std::string& listName, int index); /*! - Returns a list all entries lists - */ + Returns a list all entries lists + */ virtual std::vector getLists(); /*! - Sets a new named parameter value for the given entry - */ + Sets a new named parameter value for the given entry + */ virtual void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value); /*! - Gets a named parameter value for the given entry - */ + Gets a named parameter value for the given entry + */ virtual std::string getParameter(const std::string& entry, const std::string& parameterName); /*! - Returns all parameter names of the given entry - */ + Returns all parameter names of the given entry + */ virtual std::vector getAllParameterNames(const std::string& entry); /*! - Returns all parameter values of the given entry - */ + Returns all parameter values of the given entry + */ virtual std::vector getAllParameterValues(const std::string& entry); /*! - Returns a number of parameters of the given entry - */ + Returns a number of parameters of the given entry + */ virtual int getNbParameters(const std::string& entry); /*! - Returns a list all entries - */ + Returns a list all entries + */ virtual std::vector getEntries(); /*! - Sets a global named property value - */ + Sets a global named property value + */ virtual void setProperty(const std::string& name, const std::string& value); /*! - Gets a value of global named property - */ + Gets a value of global named property + */ virtual std::string getProperty(const std::string& name); /*! - Returns a list all properties - */ + Returns a list all properties + */ virtual std::vector getProperties(); /*! - Returns decoded entry that is an absolute entry - */ + Returns decoded entry that is an absolute entry + */ virtual std::string decodeEntry(const std::string& entry); /*! - Returns whether there is the dumping visual parameters - */ + Returns whether there is the dumping visual parameters + */ static bool isDumpPython(SALOMEDSImpl_Study* study, const std::string& theID = ""); /*! - Returns an ID of the last save point + Returns an ID of the last save point */ static int getLastSavePoint(SALOMEDSImpl_Study* study, const std::string& theID = ""); /*! - Returns a Python script for the study, which sets up visual parameters + Returns a Python script for the study, which sets up visual parameters */ static std::string getStudyScript(SALOMEDSImpl_Study* study, int savePoint, const std::string& theID = ""); /*! - Returns a default Python script that set ups visual parameters for the given module - shift is a string that contain spaces to make valid Python script indentaion + Returns a default Python script that set ups visual parameters for the given module + shift is a string that contain spaces to make valid Python script indentaion */ static std::string getDefaultScript(SALOMEDSImpl_Study* study, - const std::string& moduleName, - const std::string& shift, - const std::string& theID = ""); + const std::string& moduleName, + const std::string& shift, + const std::string& theID = ""); /*! - Returns a default name of the component where the visula parameters are stored. + Returns a default name of the component where the visula parameters are stored. */ static std::string getDefaultVisualComponent(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx index 1803e537a..ecd8123dc 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx @@ -25,33 +25,34 @@ #define __SALOMEDSIMPL_SCOMPONENT_H__ //SALOMEDSImpl headers +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_SObject.hxx" // std C++ headers #include #include -// Cascade headers #include "DF_Label.hxx" #include "SALOMEDSImpl_SObject.hxx" #include -class SALOMEDSImpl_SComponent : public virtual SALOMEDSImpl_SObject +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_SComponent : + public virtual SALOMEDSImpl_SObject { public: - - Standard_EXPORT SALOMEDSImpl_SComponent(); - Standard_EXPORT SALOMEDSImpl_SComponent(const SALOMEDSImpl_SComponent& theSCO); - Standard_EXPORT SALOMEDSImpl_SComponent(const DF_Label& lab); - - Standard_EXPORT ~SALOMEDSImpl_SComponent(); - - Standard_EXPORT virtual std::string ComponentDataType(); - Standard_EXPORT virtual bool ComponentIOR(std::string& theID); - - Standard_EXPORT static bool IsA(const DF_Label& theLabel); - - Standard_EXPORT SALOMEDSImpl_SComponent* GetPersistentCopy() const; + + SALOMEDSImpl_SComponent(); + SALOMEDSImpl_SComponent(const SALOMEDSImpl_SComponent& theSCO); + SALOMEDSImpl_SComponent(const DF_Label& lab); + + ~SALOMEDSImpl_SComponent(); + + virtual std::string ComponentDataType(); + virtual bool ComponentIOR(std::string& theID); + + static bool IsA(const DF_Label& theLabel); + + SALOMEDSImpl_SComponent* GetPersistentCopy() const; }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx index 1194fc191..ec4386e48 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx @@ -26,15 +26,15 @@ //SALOMEDSImpl headers +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_SComponent.hxx" -// Cascade headers #include "DF_ChildIterator.hxx" #include "DF_Label.hxx" #include "DF_Document.hxx" #include -class Standard_EXPORT SALOMEDSImpl_SComponentIterator +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_SComponentIterator { private: @@ -42,7 +42,7 @@ private: DF_Label _lab; public: - + SALOMEDSImpl_SComponentIterator(const SALOMEDSImpl_SComponentIterator& theIterator) { _it = theIterator._it; @@ -50,11 +50,11 @@ public: } SALOMEDSImpl_SComponentIterator() {}; - + SALOMEDSImpl_SComponentIterator(DF_Document* theDocument); - + ~SALOMEDSImpl_SComponentIterator() {}; - + virtual void Init(); virtual bool More(); virtual void Next(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx index 80d797e41..64f630a44 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx @@ -24,6 +24,8 @@ #ifndef __SALOMEDSIMPL_SOBJECT_H__ #define __SALOMEDSIMPL_SOBJECT_H__ +#include "SALOMEDSImpl_Defines.hxx" + #include "DF_Label.hxx" #include "DF_Attribute.hxx" #include @@ -32,7 +34,7 @@ class SALOMEDSImpl_SComponent; class SALOMEDSImpl_Study; -class SALOMEDSImpl_SObject +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_SObject { protected: DF_Label _lab; @@ -41,45 +43,45 @@ protected: std::string _type; public: - - Standard_EXPORT SALOMEDSImpl_SObject(); - Standard_EXPORT SALOMEDSImpl_SObject(const DF_Label& theLabel); - Standard_EXPORT SALOMEDSImpl_SObject(const SALOMEDSImpl_SObject& theSObject); - Standard_EXPORT virtual ~SALOMEDSImpl_SObject(); - - Standard_EXPORT virtual std::string GetID() const; - Standard_EXPORT virtual SALOMEDSImpl_SComponent GetFatherComponent() const; - Standard_EXPORT virtual SALOMEDSImpl_SObject GetFather() const ; - Standard_EXPORT virtual bool FindAttribute(DF_Attribute*& theAttribute, const std::string& theTypeOfAttribute) const; - Standard_EXPORT virtual bool ReferencedObject(SALOMEDSImpl_SObject& theObject) const ; - Standard_EXPORT virtual bool FindSubObject(int theTag, SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual SALOMEDSImpl_Study* GetStudy() const; - Standard_EXPORT virtual std::string Name() const { return _name; } - Standard_EXPORT virtual void Name(const std::string& theName) { _name = theName; } - Standard_EXPORT virtual std::vector GetAllAttributes() const; + SALOMEDSImpl_SObject(); + SALOMEDSImpl_SObject(const DF_Label& theLabel); + SALOMEDSImpl_SObject(const SALOMEDSImpl_SObject& theSObject); + virtual ~SALOMEDSImpl_SObject(); + + virtual std::string GetID() const; + virtual SALOMEDSImpl_SComponent GetFatherComponent() const; + virtual SALOMEDSImpl_SObject GetFather() const ; + virtual bool FindAttribute(DF_Attribute*& theAttribute, const std::string& theTypeOfAttribute) const; + virtual bool ReferencedObject(SALOMEDSImpl_SObject& theObject) const ; + virtual bool FindSubObject(int theTag, SALOMEDSImpl_SObject& theObject); + + virtual SALOMEDSImpl_Study* GetStudy() const; + virtual std::string Name() const { return _name; } + virtual void Name(const std::string& theName) { _name = theName; } + virtual std::vector GetAllAttributes() const; + + virtual std::string GetName() const ; + virtual std::string GetComment() const; + virtual std::string GetIOR() const; + + virtual int Tag() const { return _lab.Tag(); } + virtual int Depth() const { return _lab.Depth(); } - Standard_EXPORT virtual std::string GetName() const ; - Standard_EXPORT virtual std::string GetComment() const; - Standard_EXPORT virtual std::string GetIOR() const; + virtual DF_Label GetLabel() const { return _lab; } - Standard_EXPORT virtual int Tag() const { return _lab.Tag(); } - Standard_EXPORT virtual int Depth() const { return _lab.Depth(); } + bool IsNull() const { return _lab.IsNull(); } - Standard_EXPORT virtual DF_Label GetLabel() const { return _lab; } + bool IsComponent() const; - Standard_EXPORT bool IsNull() const { return _lab.IsNull(); } + operator SALOMEDSImpl_SComponent() const; - Standard_EXPORT bool IsComponent() const; + operator bool () const { return !IsNull(); } - Standard_EXPORT operator SALOMEDSImpl_SComponent() const; + SALOMEDSImpl_SObject* GetPersistentCopy() const; - Standard_EXPORT operator bool () const { return !IsNull(); } - - Standard_EXPORT SALOMEDSImpl_SObject* GetPersistentCopy() const; + static std::string GetGUID(const std::string& theTypeOfAttribute); - Standard_EXPORT static std::string GetGUID(const std::string& theTypeOfAttribute); - }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx index cfddeb627..2d3881a8a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx @@ -30,12 +30,12 @@ #include #include -// Cascade headers #include "DF_Document.hxx" #include "DF_Label.hxx" #include //SALOMEDSImpl headers +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_SComponentIterator.hxx" #include "SALOMEDSImpl_SObject.hxx" #include "SALOMEDSImpl_StudyBuilder.hxx" @@ -51,7 +51,7 @@ class SALOMEDSImpl_StudyManager; class SALOMEDSImpl_GenericAttribute; -class SALOMEDSImpl_Study +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Study { private: std::string _name; @@ -70,194 +70,194 @@ private: std::map _mapOfSO; std::map _mapOfSCO; std::map myIORLabels; - + SALOMEDSImpl_SObject _FindObject(const SALOMEDSImpl_SObject& SO, - const std::string& anObjectName, - bool& _find); - + const std::string& anObjectName, + bool& _find); + SALOMEDSImpl_SObject _FindObjectIOR(const SALOMEDSImpl_SObject& SO, - const std::string& anObjectIOR, - bool& _find); + const std::string& anObjectIOR, + bool& _find); public: - Standard_EXPORT static SALOMEDSImpl_Study* GetStudy(const DF_Label& theLabel); - Standard_EXPORT static SALOMEDSImpl_SObject SObject(const DF_Label& theLabel); - Standard_EXPORT static SALOMEDSImpl_SComponent SComponent(const DF_Label& theLabel); - Standard_EXPORT static void IORUpdated(const SALOMEDSImpl_AttributeIOR* theAttribute); + static SALOMEDSImpl_Study* GetStudy(const DF_Label& theLabel); + static SALOMEDSImpl_SObject SObject(const DF_Label& theLabel); + static SALOMEDSImpl_SComponent SComponent(const DF_Label& theLabel); + static void IORUpdated(const SALOMEDSImpl_AttributeIOR* theAttribute); //! standard constructor - Standard_EXPORT SALOMEDSImpl_Study(const DF_Document*, const std::string& study_name); - + SALOMEDSImpl_Study(const DF_Document*, const std::string& study_name); + //! standard destructor - Standard_EXPORT virtual ~SALOMEDSImpl_Study(); - + virtual ~SALOMEDSImpl_Study(); + //! method to Get persistent reference of study (idem URL()) - Standard_EXPORT virtual std::string GetPersistentReference(); + virtual std::string GetPersistentReference(); //! method to Get transient reference of study - Standard_EXPORT virtual std::string GetTransientReference(); + virtual std::string GetTransientReference(); - Standard_EXPORT virtual void SetTransientReference(const std::string& theIOR); + virtual void SetTransientReference(const std::string& theIOR); //! method to detect if a study is empty - Standard_EXPORT virtual bool IsEmpty(); + virtual bool IsEmpty(); //! method to Find a Component with ComponentDataType = aComponentName - Standard_EXPORT virtual SALOMEDSImpl_SComponent FindComponent (const std::string& aComponentName); + virtual SALOMEDSImpl_SComponent FindComponent (const std::string& aComponentName); //! method to Find a Component Find a Component from it's ID - Standard_EXPORT virtual SALOMEDSImpl_SComponent FindComponentID(const std::string& aComponentID); + virtual SALOMEDSImpl_SComponent FindComponentID(const std::string& aComponentID); //! method to Find an Object with SALOMEDSImpl::Name = anObjectName - Standard_EXPORT virtual SALOMEDSImpl_SObject FindObject(const std::string& anObjectName); + virtual SALOMEDSImpl_SObject FindObject(const std::string& anObjectName); //! method to Find Object(s) with SALOMEDSImpl::Name=anObjectName in a component with ComponentDataType = aComponentName - Standard_EXPORT virtual std::vector FindObjectByName( const std::string& anObjectName, - const std::string& aComponentName ) ; - + virtual std::vector FindObjectByName( const std::string& anObjectName, + const std::string& aComponentName ) ; + //! method to Find an Object with ID = anObjectID - Standard_EXPORT virtual SALOMEDSImpl_SObject FindObjectID(const std::string& anObjectID); + virtual SALOMEDSImpl_SObject FindObjectID(const std::string& anObjectID); //! method to Create an Object with ID = anObjectID - Standard_EXPORT virtual SALOMEDSImpl_SObject CreateObjectID(const std::string& anObjectID); + virtual SALOMEDSImpl_SObject CreateObjectID(const std::string& anObjectID); //! method to Find an Object with ID = anObjectIOR - Standard_EXPORT virtual SALOMEDSImpl_SObject FindObjectIOR(const std::string& anObjectIOR); + virtual SALOMEDSImpl_SObject FindObjectIOR(const std::string& anObjectIOR); //! method to Find an Object by its path - Standard_EXPORT virtual SALOMEDSImpl_SObject FindObjectByPath(const std::string& thePath); + virtual SALOMEDSImpl_SObject FindObjectByPath(const std::string& thePath); //! method to get a path of SObject - Standard_EXPORT virtual std::string GetObjectPath(const SALOMEDSImpl_SObject& theObject); + virtual std::string GetObjectPath(const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT std::string GetObjectPathByIOR(const std::string& theIOR); + std::string GetObjectPathByIOR(const std::string& theIOR); //! method to set a context: root ('/') is UserData component - Standard_EXPORT virtual bool SetContext(const std::string& thePath); + virtual bool SetContext(const std::string& thePath); //! method to get a context - Standard_EXPORT virtual std::string GetContext(); + virtual std::string GetContext(); //! method to get all object names in the given context (or in the current context, if 'theContext' is empty) - Standard_EXPORT virtual std::vector GetObjectNames(const std::string& theContext); + virtual std::vector GetObjectNames(const std::string& theContext); //! method to get all directory names in the given context (or in the current context, if 'theContext' is empty) - Standard_EXPORT virtual std::vector GetDirectoryNames(const std::string& theContext); + virtual std::vector GetDirectoryNames(const std::string& theContext); //! method to get all file names in the given context (or in the current context, if 'theContext' is empty) - Standard_EXPORT virtual std::vector GetFileNames(const std::string& theContext); + virtual std::vector GetFileNames(const std::string& theContext); //! method to get all components names - Standard_EXPORT virtual std::vector GetComponentNames(const std::string& theContext); + virtual std::vector GetComponentNames(const std::string& theContext); //! method to Create a ChildIterator from an SObject - Standard_EXPORT virtual SALOMEDSImpl_ChildIterator NewChildIterator(const SALOMEDSImpl_SObject& aSO); + virtual SALOMEDSImpl_ChildIterator NewChildIterator(const SALOMEDSImpl_SObject& aSO); //! method to Create a SComponentIterator - Standard_EXPORT virtual SALOMEDSImpl_SComponentIterator NewComponentIterator(); + virtual SALOMEDSImpl_SComponentIterator NewComponentIterator(); //! method to Create a StudyBuilder - Standard_EXPORT virtual SALOMEDSImpl_StudyBuilder* NewBuilder(); - + virtual SALOMEDSImpl_StudyBuilder* NewBuilder(); + //! method to get study name - Standard_EXPORT virtual std::string Name(); + virtual std::string Name(); //! method to set study name - Standard_EXPORT virtual void Name(const std::string& name); + virtual void Name(const std::string& name); //! method to get if study has been saved - Standard_EXPORT virtual bool IsSaved(); + virtual bool IsSaved(); //! method to set if study has been saved - Standard_EXPORT virtual void IsSaved(bool save); + virtual void IsSaved(bool save); //! method to Detect if a Study has been modified since it has been saved - Standard_EXPORT virtual bool IsModified(); + virtual bool IsModified(); //! method to get URL of the study (idem GetPersistentReference) - Standard_EXPORT virtual std::string URL(); + virtual std::string URL(); //! method to set URL of the study - Standard_EXPORT virtual void URL(const std::string& url); + virtual void URL(const std::string& url); - Standard_EXPORT virtual bool IsLocked(); + virtual bool IsLocked(); - Standard_EXPORT virtual int StudyId(); + virtual int StudyId(); - Standard_EXPORT virtual void StudyId(int id); + virtual void StudyId(int id); - Standard_EXPORT virtual void UpdateIORLabelMap(const std::string& anIOR, const std::string& aLabel); - - Standard_EXPORT virtual std::vector FindDependances(const SALOMEDSImpl_SObject& anObject); + virtual void UpdateIORLabelMap(const std::string& anIOR, const std::string& aLabel); - Standard_EXPORT virtual SALOMEDSImpl_AttributeStudyProperties* GetProperties(); + virtual std::vector FindDependances(const SALOMEDSImpl_SObject& anObject); - Standard_EXPORT virtual std::string GetLastModificationDate(); + virtual SALOMEDSImpl_AttributeStudyProperties* GetProperties(); - Standard_EXPORT virtual std::vector GetModificationsDate(); + virtual std::string GetLastModificationDate(); - Standard_EXPORT virtual SALOMEDSImpl_UseCaseBuilder* GetUseCaseBuilder(); + virtual std::vector GetModificationsDate(); - Standard_EXPORT virtual void Close(); + virtual SALOMEDSImpl_UseCaseBuilder* GetUseCaseBuilder(); - Standard_EXPORT void EnableUseCaseAutoFilling(bool isEnabled); + virtual void Close(); - Standard_EXPORT virtual std::string GetErrorCode() { return _errorCode; } - Standard_EXPORT virtual bool IsError() { return _errorCode != ""; } + void EnableUseCaseAutoFilling(bool isEnabled); - Standard_EXPORT virtual SALOMEDSImpl_SComponent GetSComponent(const std::string& theEntry); - Standard_EXPORT virtual SALOMEDSImpl_SComponent GetSComponent(const DF_Label& theLabel); - Standard_EXPORT virtual SALOMEDSImpl_SObject GetSObject(const std::string& theEntry); - Standard_EXPORT virtual SALOMEDSImpl_SObject GetSObject(const DF_Label& theEntryLabel); - Standard_EXPORT virtual DF_Attribute* GetAttribute(const std::string& theEntry, - const std::string& theType); + virtual std::string GetErrorCode() { return _errorCode; } + virtual bool IsError() { return _errorCode != ""; } - Standard_EXPORT virtual bool HasCurrentContext() { return !_current.IsNull(); } + virtual SALOMEDSImpl_SComponent GetSComponent(const std::string& theEntry); + virtual SALOMEDSImpl_SComponent GetSComponent(const DF_Label& theLabel); + virtual SALOMEDSImpl_SObject GetSObject(const std::string& theEntry); + virtual SALOMEDSImpl_SObject GetSObject(const DF_Label& theEntryLabel); + virtual DF_Attribute* GetAttribute(const std::string& theEntry, + const std::string& theType); - Standard_EXPORT virtual bool DumpStudy(const std::string& thePath, - const std::string& theBaseName, - bool isPublished, - SALOMEDSImpl_DriverFactory* theFactory); + virtual bool HasCurrentContext() { return !_current.IsNull(); } - Standard_EXPORT static std::string GetDumpStudyComment(const char* theComponentName = 0); + virtual bool DumpStudy(const std::string& thePath, + const std::string& theBaseName, + bool isPublished, + SALOMEDSImpl_DriverFactory* theFactory); - Standard_EXPORT virtual DF_Document* GetDocument() { return _doc; } + static std::string GetDumpStudyComment(const char* theComponentName = 0); + + virtual DF_Document* GetDocument() { return _doc; } //The method dump creates a txt file that contain a dump of the study, for debug use - Standard_EXPORT void dump(const std::string& theFileName); + void dump(const std::string& theFileName); //This method marks the study as being modified - Standard_EXPORT void Modify(); + void Modify(); - Standard_EXPORT SALOMEDSImpl_AttributeParameter* GetCommonParameters(const char* theID, int theSavePoint); + SALOMEDSImpl_AttributeParameter* GetCommonParameters(const char* theID, int theSavePoint); - Standard_EXPORT SALOMEDSImpl_AttributeParameter* GetModuleParameters(const char* theID, - const char* theModuleName, - int theSavePoint); + SALOMEDSImpl_AttributeParameter* GetModuleParameters(const char* theID, + const char* theModuleName, + int theSavePoint); //Locks the study, theLockerID is identificator of the of the one who locked the study for ex. IOR - Standard_EXPORT void SetStudyLock(const char* theLockerID); + void SetStudyLock(const char* theLockerID); //Returns True if the study is locked - Standard_EXPORT bool IsStudyLocked(); + bool IsStudyLocked(); //Unlocks the study - Standard_EXPORT void UnLockStudy(const char* theLockerID); - + void UnLockStudy(const char* theLockerID); + //Returns an ID of the study locker - Standard_EXPORT std::vector GetLockerID(); + std::vector GetLockerID(); //Returns a callback - Standard_EXPORT SALOMEDSImpl_Callback* GetCallback() { return _cb; } + SALOMEDSImpl_Callback* GetCallback() { return _cb; } //Returns a list of IOR's stored in the study - Standard_EXPORT std::vector GetIORs(); + std::vector GetIORs(); -friend class SALOMEDSImpl_StudyManager; -friend class SALOMEDSImpl_GenericAttribute; + friend class SALOMEDSImpl_StudyManager; + friend class SALOMEDSImpl_GenericAttribute; }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx index 781103cb6..7d84804a1 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx @@ -24,17 +24,18 @@ #ifndef __SALOMEDSImpl_STUDYBUILDER_H__ #define __SALOMEDSImpl_STUDYBUILDER_H__ +#include "SALOMEDSImpl_Defines.hxx" // std C++ headers #include #include #include - + #include "SALOMEDSImpl_Callback.hxx" #include "SALOMEDSImpl_Driver.hxx" class SALOMEDSImpl_Study; -class SALOMEDSImpl_StudyBuilder +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_StudyBuilder { private: DF_Document* _doc; @@ -44,74 +45,74 @@ private: std::string _errorCode; public: - - Standard_EXPORT SALOMEDSImpl_StudyBuilder(const SALOMEDSImpl_Study* theOwner); - Standard_EXPORT ~SALOMEDSImpl_StudyBuilder(); + SALOMEDSImpl_StudyBuilder(const SALOMEDSImpl_Study* theOwner); + + ~SALOMEDSImpl_StudyBuilder(); + + virtual SALOMEDSImpl_SComponent NewComponent(const std::string& ComponentDataType); - Standard_EXPORT virtual SALOMEDSImpl_SComponent NewComponent(const std::string& ComponentDataType); + virtual bool DefineComponentInstance (const SALOMEDSImpl_SComponent&, const std::string& ComponentIOR); - Standard_EXPORT virtual bool DefineComponentInstance (const SALOMEDSImpl_SComponent&, const std::string& ComponentIOR); - - Standard_EXPORT virtual bool RemoveComponent(const SALOMEDSImpl_SComponent& aComponent); + virtual bool RemoveComponent(const SALOMEDSImpl_SComponent& aComponent); - Standard_EXPORT virtual SALOMEDSImpl_SObject NewObject(const SALOMEDSImpl_SObject& theFatherObject); + virtual SALOMEDSImpl_SObject NewObject(const SALOMEDSImpl_SObject& theFatherObject); - Standard_EXPORT virtual SALOMEDSImpl_SObject NewObjectToTag(const SALOMEDSImpl_SObject& theFatherObject, - const int theTag); + virtual SALOMEDSImpl_SObject NewObjectToTag(const SALOMEDSImpl_SObject& theFatherObject, + const int theTag); //! The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used) - Standard_EXPORT virtual bool AddDirectory(const std::string& thePath); + virtual bool AddDirectory(const std::string& thePath); - Standard_EXPORT virtual bool LoadWith(const SALOMEDSImpl_SComponent& sco, SALOMEDSImpl_Driver* Engine); - Standard_EXPORT virtual bool Load(const SALOMEDSImpl_SObject& sco); + virtual bool LoadWith(const SALOMEDSImpl_SComponent& sco, SALOMEDSImpl_Driver* Engine); + virtual bool Load(const SALOMEDSImpl_SObject& sco); - Standard_EXPORT virtual bool RemoveObject(const SALOMEDSImpl_SObject& anObject); - Standard_EXPORT virtual bool RemoveObjectWithChildren(const SALOMEDSImpl_SObject& anObject); + virtual bool RemoveObject(const SALOMEDSImpl_SObject& anObject); + virtual bool RemoveObjectWithChildren(const SALOMEDSImpl_SObject& anObject); - Standard_EXPORT virtual DF_Attribute* FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject, - const std::string& aTypeOfAttribute); - Standard_EXPORT virtual bool FindAttribute(const SALOMEDSImpl_SObject& anObject, - DF_Attribute*& anAttribute, - const std::string& aTypeOfAttribute); + virtual DF_Attribute* FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject, + const std::string& aTypeOfAttribute); + virtual bool FindAttribute(const SALOMEDSImpl_SObject& anObject, + DF_Attribute*& anAttribute, + const std::string& aTypeOfAttribute); - Standard_EXPORT virtual bool RemoveAttribute(const SALOMEDSImpl_SObject& anObject, const std::string& aTypeOfAttribute); + virtual bool RemoveAttribute(const SALOMEDSImpl_SObject& anObject, const std::string& aTypeOfAttribute); - Standard_EXPORT virtual bool Addreference(const SALOMEDSImpl_SObject& me, - const SALOMEDSImpl_SObject& thereferencedObject); + virtual bool Addreference(const SALOMEDSImpl_SObject& me, + const SALOMEDSImpl_SObject& thereferencedObject); - Standard_EXPORT virtual bool RemoveReference(const SALOMEDSImpl_SObject& me); + virtual bool RemoveReference(const SALOMEDSImpl_SObject& me); - Standard_EXPORT virtual bool SetGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID); - Standard_EXPORT virtual bool IsGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID); + virtual bool SetGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID); + virtual bool IsGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID); - Standard_EXPORT virtual void NewCommand(); - Standard_EXPORT virtual void CommitCommand(); - Standard_EXPORT virtual bool HasOpenCommand(); - Standard_EXPORT virtual void AbortCommand(); - Standard_EXPORT virtual void Undo(); - Standard_EXPORT virtual void Redo(); - Standard_EXPORT bool GetAvailableUndos(); - Standard_EXPORT bool GetAvailableRedos(); - Standard_EXPORT bool IsSaved(); - Standard_EXPORT bool IsModified(); - Standard_EXPORT virtual int UndoLimit(); - Standard_EXPORT virtual void UndoLimit(const int); + virtual void NewCommand(); + virtual void CommitCommand(); + virtual bool HasOpenCommand(); + virtual void AbortCommand(); + virtual void Undo(); + virtual void Redo(); + bool GetAvailableUndos(); + bool GetAvailableRedos(); + bool IsSaved(); + bool IsModified(); + virtual int UndoLimit(); + virtual void UndoLimit(const int); - Standard_EXPORT void CheckLocked(); + void CheckLocked(); - Standard_EXPORT virtual SALOMEDSImpl_Callback* SetOnAddSObject(const SALOMEDSImpl_Callback* theCallback); - Standard_EXPORT virtual SALOMEDSImpl_Callback* SetOnRemoveSObject(const SALOMEDSImpl_Callback* theCallback); + virtual SALOMEDSImpl_Callback* SetOnAddSObject(const SALOMEDSImpl_Callback* theCallback); + virtual SALOMEDSImpl_Callback* SetOnRemoveSObject(const SALOMEDSImpl_Callback* theCallback); - Standard_EXPORT virtual bool SetName(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); + virtual bool SetName(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); - Standard_EXPORT virtual bool SetComment(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); + virtual bool SetComment(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); - Standard_EXPORT virtual bool SetIOR(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); + virtual bool SetIOR(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); - Standard_EXPORT virtual std::string GetErrorCode() { return _errorCode; } - Standard_EXPORT virtual bool IsError() { return _errorCode != ""; } + virtual std::string GetErrorCode() { return _errorCode; } + virtual bool IsError() { return _errorCode != ""; } - Standard_EXPORT virtual SALOMEDSImpl_Study* GetOwner() { return _study; } + virtual SALOMEDSImpl_Study* GetOwner() { return _study; } }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx index 5d8cff6a2..fe13af984 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx @@ -24,37 +24,35 @@ #ifndef SALOMEDSImpl_StudyHandle_HeaderFile #define SALOMEDSImpl_StudyHandle_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" /* - Class : SALOMEDSImpl_StudyHandle - Description : PRIVATE: This class is intended for storing of the study handle +Class : SALOMEDSImpl_StudyHandle +Description : PRIVATE: This class is intended for storing of the study handle */ #include "SALOMEDSImpl_Study.hxx" -#ifndef WNT -class Standard_EXPORT SALOMEDSImpl_StudyHandle : public DF_Attribute -#else -class SALOMEDSImpl_StudyHandle : public DF_Attribute -#endif +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_StudyHandle : + public DF_Attribute { public: -Standard_EXPORT SALOMEDSImpl_StudyHandle(); -Standard_EXPORT ~SALOMEDSImpl_StudyHandle() {; } - -Standard_EXPORT static SALOMEDSImpl_StudyHandle* Set(const DF_Label& theLabel, SALOMEDSImpl_Study* theStudy); -Standard_EXPORT static const std::string& GetID() ; - -Standard_EXPORT void Set(SALOMEDSImpl_Study* theStudy) { myHandle = theStudy; } -Standard_EXPORT SALOMEDSImpl_Study* Get() { return myHandle; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore( DF_Attribute* theWith ); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste( DF_Attribute* theInto); - + SALOMEDSImpl_StudyHandle(); + ~SALOMEDSImpl_StudyHandle() {; } + + static SALOMEDSImpl_StudyHandle* Set(const DF_Label& theLabel, SALOMEDSImpl_Study* theStudy); + static const std::string& GetID() ; + + void Set(SALOMEDSImpl_Study* theStudy) { myHandle = theStudy; } + SALOMEDSImpl_Study* Get() { return myHandle; } + const std::string& ID() const; + void Restore( DF_Attribute* theWith ); + DF_Attribute* NewEmpty() const; + void Paste( DF_Attribute* theInto); + private: SALOMEDSImpl_Study* myHandle; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index 428c5b636..bd904c91b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -462,7 +462,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aUrl, HDFdataset *hdf_dataset =0; hdf_size size[1]; hdf_int32 name_len = 0; - char *component_name = 0; + string component_name; if(!aStudy) { _errorCode = "Study is null"; @@ -609,12 +609,12 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aUrl, hdf_sco_group2->CreateOnDisk(); SaveAttributes(SC, hdf_sco_group2); // ComponentDataType treatment - component_name = (char*)SC.ComponentDataType().c_str(); - name_len = (hdf_int32)strlen(component_name); + component_name = SC.ComponentDataType(); + name_len = (hdf_int32)component_name.length(); size[0] = name_len +1 ; hdf_dataset = new HDFdataset("COMPONENTDATATYPE",hdf_sco_group2,HDF_STRING,size,1); hdf_dataset->CreateOnDisk(); - hdf_dataset->WriteOnDisk(component_name); + hdf_dataset->WriteOnDisk((char*)component_name.c_str()); hdf_dataset->CloseOnDisk(); hdf_dataset=0; //will be deleted by hdf_sco_group destructor Impl_SaveObject(SC, hdf_sco_group2); @@ -638,12 +638,12 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aUrl, //----------------------------------------------------------------------- //5 - Write the Study Properties //----------------------------------------------------------------------- - name_len = (hdf_int32) aStudy->Name().size(); + string study_name = aStudy->Name(); + name_len = (hdf_int32) study_name.size(); size[0] = name_len +1 ; hdf_dataset = new HDFdataset("STUDY_NAME",hdf_group_study_structure,HDF_STRING,size,1); hdf_dataset->CreateOnDisk(); - char* studid = (char*)aStudy->Name().c_str(); - hdf_dataset->WriteOnDisk(studid); + hdf_dataset->WriteOnDisk((char*)study_name.c_str()); hdf_dataset->CloseOnDisk(); hdf_dataset=0; // will be deleted by hdf_group_study_structure destructor @@ -717,8 +717,8 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const SALOMEDSImpl_SObject& SC, SALOMEDSImpl_SObject SO = SALOMEDSImpl_Study::SObject(itchild.Value()); - char* scoid = (char*) SO.GetID().c_str(); - hdf_group_sobject = new HDFgroup(scoid, hdf_group_datatype); + string scoid = SO.GetID(); + hdf_group_sobject = new HDFgroup(scoid.c_str(), hdf_group_datatype); hdf_group_sobject->CreateOnDisk(); SaveAttributes(SO, hdf_group_sobject); Impl_SaveObject(SO, hdf_group_sobject); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.hxx index 190317bbc..b42dd8451 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.hxx @@ -24,6 +24,8 @@ #ifndef __SALOMEDSImpl_STUDYMANAGER_I_H__ #define __SALOMEDSImpl_STUDYMANAGER_I_H__ +#include "SALOMEDSImpl_Defines.hxx" + // std C++ headers #include #include @@ -39,7 +41,7 @@ class HDFgroup; -class SALOMEDSImpl_StudyManager +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_StudyManager { private: @@ -52,87 +54,87 @@ private: public: //! standard constructor - Standard_EXPORT SALOMEDSImpl_StudyManager(); + SALOMEDSImpl_StudyManager(); //! standard destructor - Standard_EXPORT virtual ~SALOMEDSImpl_StudyManager(); + virtual ~SALOMEDSImpl_StudyManager(); //! method to Create a New Study of name study_name - Standard_EXPORT virtual SALOMEDSImpl_Study* NewStudy(const std::string& study_name); + virtual SALOMEDSImpl_Study* NewStudy(const std::string& study_name); //! method to Open a Study from it's persistent reference - Standard_EXPORT virtual SALOMEDSImpl_Study* Open(const std::string& aStudyUrl); + virtual SALOMEDSImpl_Study* Open(const std::string& aStudyUrl); //! method to close a Study - Standard_EXPORT virtual void Close(SALOMEDSImpl_Study* aStudy); + virtual void Close(SALOMEDSImpl_Study* aStudy); //! method to save a Study - Standard_EXPORT virtual bool Save(SALOMEDSImpl_Study* aStudy, SALOMEDSImpl_DriverFactory* aFactory, bool theMultiFile); + virtual bool Save(SALOMEDSImpl_Study* aStudy, SALOMEDSImpl_DriverFactory* aFactory, bool theMultiFile); - Standard_EXPORT virtual bool SaveASCII(SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile); + virtual bool SaveASCII(SALOMEDSImpl_Study* aStudy, + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile); //! method to save a Study to the persistent reference aUrl - Standard_EXPORT virtual bool SaveAs(const std::string& aUrl, - SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile); + virtual bool SaveAs(const std::string& aUrl, + SALOMEDSImpl_Study* aStudy, + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile); - Standard_EXPORT virtual bool SaveAsASCII(const std::string& aUrl, - SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile); + virtual bool SaveAsASCII(const std::string& aUrl, + SALOMEDSImpl_Study* aStudy, + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile); //! method to Get name list of open studies in the session - Standard_EXPORT virtual std::vector GetOpenStudies(); + virtual std::vector GetOpenStudies(); //! method to get a Study from it's name - Standard_EXPORT virtual SALOMEDSImpl_Study* GetStudyByName(const std::string& aStudyName) ; + virtual SALOMEDSImpl_Study* GetStudyByName(const std::string& aStudyName) ; //! method to get a Study from it's ID - Standard_EXPORT virtual SALOMEDSImpl_Study* GetStudyByID(int aStudyID) ; - - - Standard_EXPORT DF_Document* GetDocumentOfStudy(SALOMEDSImpl_Study* theStudy); - - Standard_EXPORT DF_Document* GetClipboard() { return _clipboard; } - - Standard_EXPORT bool CopyLabel(SALOMEDSImpl_Study* theSourceStudy, - SALOMEDSImpl_Driver* theEngine, - const int theSourceStartDepth, - const DF_Label& theSource, - const DF_Label& theDestinationMain); - - Standard_EXPORT DF_Label PasteLabel(SALOMEDSImpl_Study* theDestinationStudy, - SALOMEDSImpl_Driver* theEngine, - const DF_Label& theSource, - const DF_Label& theDestinationStart, - const int theCopiedStudyID, - const bool isFirstElement); - - Standard_EXPORT virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); - Standard_EXPORT virtual bool Copy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); - Standard_EXPORT virtual bool CanPaste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); - Standard_EXPORT virtual SALOMEDSImpl_SObject Paste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); + virtual SALOMEDSImpl_Study* GetStudyByID(int aStudyID) ; + + + DF_Document* GetDocumentOfStudy(SALOMEDSImpl_Study* theStudy); + + DF_Document* GetClipboard() { return _clipboard; } + + bool CopyLabel(SALOMEDSImpl_Study* theSourceStudy, + SALOMEDSImpl_Driver* theEngine, + const int theSourceStartDepth, + const DF_Label& theSource, + const DF_Label& theDestinationMain); + + DF_Label PasteLabel(SALOMEDSImpl_Study* theDestinationStudy, + SALOMEDSImpl_Driver* theEngine, + const DF_Label& theSource, + const DF_Label& theDestinationStart, + const int theCopiedStudyID, + const bool isFirstElement); + + virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); + virtual bool Copy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); + virtual bool CanPaste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); + virtual SALOMEDSImpl_SObject Paste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); // _SaveAs private function called by Save and SaveAs - Standard_EXPORT virtual bool Impl_SaveAs(const std::string& aUrl, - SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile, - bool theASCII); + virtual bool Impl_SaveAs(const std::string& aUrl, + SALOMEDSImpl_Study* aStudy, + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile, + bool theASCII); // _SaveObject private function called by _SaveAs - Standard_EXPORT virtual bool Impl_SaveObject(const SALOMEDSImpl_SObject& SC, HDFgroup *hdf_group_datatype); + virtual bool Impl_SaveObject(const SALOMEDSImpl_SObject& SC, HDFgroup *hdf_group_datatype); // _SubstituteSlash function called by Open and GetStudyByName - Standard_EXPORT virtual std::string Impl_SubstituteSlash(const std::string& aUrl); + virtual std::string Impl_SubstituteSlash(const std::string& aUrl); - Standard_EXPORT virtual bool Impl_SaveProperties(SALOMEDSImpl_Study* aStudy, HDFgroup *hdf_group); + virtual bool Impl_SaveProperties(SALOMEDSImpl_Study* aStudy, HDFgroup *hdf_group); - Standard_EXPORT std::string GetErrorCode() { return _errorCode; } - Standard_EXPORT virtual bool IsError() { return _errorCode != ""; } + std::string GetErrorCode() { return _errorCode; } + virtual bool IsError() { return _errorCode != ""; } }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx index 3d63b66cd..a9ee8d706 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx @@ -21,19 +21,20 @@ #ifndef __SALOMEDSIMPL_TMPFILE_H__ #define __SALOMEDSIMPL_TMPFILE_H__ +#include "SALOMEDSImpl_Defines.hxx" #include "DF_definitions.hxx" -struct SALOMEDSImpl_TMPFile +struct SALOMEDSIMPL_EXPORT SALOMEDSImpl_TMPFile { typedef unsigned char TOctet; //typedef unsigned int size_t; - Standard_EXPORT virtual size_t Size() = 0; + virtual size_t Size() = 0; - Standard_EXPORT virtual TOctet* Data(); + virtual TOctet* Data(); - Standard_EXPORT virtual TOctet& Get(size_t) = 0; + virtual TOctet& Get(size_t) = 0; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx index 7d817c961..fcc1745e8 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx @@ -24,12 +24,12 @@ // Project : SALOME // Module : SALOMEDSImpl -#include "SALOMEDSImpl_Tool.hxx" - #include #include #include +#include +#include "SALOMEDSImpl_Tool.hxx" #ifndef WNT #include @@ -40,10 +40,10 @@ #else #include #include +//#include +#include #endif -#include - using namespace std; @@ -153,7 +153,7 @@ void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const string& theDirectory, if(IsDirDeleted) { if(Exists(aDirName)) { #ifdef WNT - RemoveDirectory(aDireName.c_str()); + RemoveDirectory(aDirName.c_str()); #else rmdir(aDirName.c_str()); #endif @@ -202,7 +202,7 @@ string SALOMEDSImpl_Tool::GetDirFromPath(const string& thePath) { } #ifdef WNT //Check if the only disk letter is given as path - if(path.size() == 2 && path[1] == ":") path +='\\'; + if(path.size() == 2 && path[1] == ':') path +='\\'; #endif for(int i = 0, len = path.size(); i #include #include "DF_Label.hxx" -class SALOMEDSImpl_Tool +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Tool { public: diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx index c54a5dd93..d9413c443 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx @@ -24,6 +24,8 @@ #ifndef __SALOMEDSIMPL_USECaseBuilder_H__ #define __SALOMEDSIMPL_USECaseBuilder_H__ +#include "SALOMEDSImpl_Defines.hxx" + #include #include "DF_Document.hxx" @@ -31,7 +33,7 @@ #include "SALOMEDSImpl_AttributeTreeNode.hxx" #include "SALOMEDSImpl_UseCaseIterator.hxx" -class SALOMEDSImpl_UseCaseBuilder +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_UseCaseBuilder { private: @@ -41,38 +43,38 @@ private: public: //! standard constructor - Standard_EXPORT SALOMEDSImpl_UseCaseBuilder(DF_Document* theDocument); - + SALOMEDSImpl_UseCaseBuilder(DF_Document* theDocument); + //! standard destructor - Standard_EXPORT ~SALOMEDSImpl_UseCaseBuilder(); - - Standard_EXPORT virtual bool Append(const SALOMEDSImpl_SObject& theObject); + ~SALOMEDSImpl_UseCaseBuilder(); + + virtual bool Append(const SALOMEDSImpl_SObject& theObject); + + virtual bool Remove(const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual bool Remove(const SALOMEDSImpl_SObject& theObject); + virtual bool AppendTo(const SALOMEDSImpl_SObject& theFather, const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual bool AppendTo(const SALOMEDSImpl_SObject& theFather, const SALOMEDSImpl_SObject& theObject); + virtual bool InsertBefore(const SALOMEDSImpl_SObject& theFirst, const SALOMEDSImpl_SObject& theNext); - Standard_EXPORT virtual bool InsertBefore(const SALOMEDSImpl_SObject& theFirst, const SALOMEDSImpl_SObject& theNext); + virtual bool SetCurrentObject(const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual bool SetCurrentObject(const SALOMEDSImpl_SObject& theObject); - - Standard_EXPORT virtual bool SetRootCurrent(); + virtual bool SetRootCurrent(); - Standard_EXPORT virtual bool HasChildren(const SALOMEDSImpl_SObject& theObject); + virtual bool HasChildren(const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual bool IsUseCase(const SALOMEDSImpl_SObject& theObject); + virtual bool IsUseCase(const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual bool SetName(const std::string& theName); + virtual bool SetName(const std::string& theName); - Standard_EXPORT virtual SALOMEDSImpl_SObject GetCurrentObject(); + virtual SALOMEDSImpl_SObject GetCurrentObject(); - Standard_EXPORT virtual std::string GetName(); + virtual std::string GetName(); - Standard_EXPORT virtual SALOMEDSImpl_SObject AddUseCase(const std::string& theName); + virtual SALOMEDSImpl_SObject AddUseCase(const std::string& theName); - Standard_EXPORT virtual SALOMEDSImpl_UseCaseIterator GetUseCaseIterator(const SALOMEDSImpl_SObject& anObject); + virtual SALOMEDSImpl_UseCaseIterator GetUseCaseIterator(const SALOMEDSImpl_SObject& anObject); - Standard_EXPORT SALOMEDSImpl_SObject GetSObject(const std::string& theEntry); + SALOMEDSImpl_SObject GetSObject(const std::string& theEntry); }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx index a01cb1040..7d0182eb0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx @@ -24,13 +24,15 @@ #ifndef __SALOMEDSIMPL_USECASEITERATOR_H__ #define __SALOMEDSIMPL_USECASEITERATOR_H__ +#include "SALOMEDSImpl_Defines.hxx" + #include "SALOMEDSImpl_SObject.hxx" #include "DF_ChildIterator.hxx" #include "SALOMEDSImpl_ChildNodeIterator.hxx" #include -class Standard_EXPORT SALOMEDSImpl_UseCaseIterator +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_UseCaseIterator { private: @@ -45,12 +47,12 @@ public: //! standard constructor SALOMEDSImpl_UseCaseIterator(const DF_Label& theLabel, - const std::string& theGUID, - const bool allLevels); - + const std::string& theGUID, + const bool allLevels); + //! standard destructor ~SALOMEDSImpl_UseCaseIterator(); - + virtual void Init(bool); virtual bool More(); virtual void Next(); diff --git a/src/TOOLSDS/SALOMEDS_Tool.cxx b/src/TOOLSDS/SALOMEDS_Tool.cxx index fcf2be69d..290206e08 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.cxx +++ b/src/TOOLSDS/SALOMEDS_Tool.cxx @@ -27,13 +27,12 @@ #include "SALOMEDS_Tool.hxx" #include "utilities.h" +#include "OpUtil.hxx" #ifndef WNT #include #include #include -#include -#include #include #include #else @@ -41,6 +40,8 @@ #include #endif +#include +#include #include #include @@ -52,7 +53,7 @@ bool Exists(const string thePath) { #ifdef WNT if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { - if ( GetLastError () != ERROR_FILE_NOT_FOUND ) { + if ( GetLastError () == ERROR_FILE_NOT_FOUND ) { return false; } } @@ -70,9 +71,10 @@ bool Exists(const string thePath) //============================================================================ std::string SALOMEDS_Tool::GetTmpDir() { + return OpUtil_Dir::GetTmpDirByEnv("SALOME_TMP_DIR"); //Find a temporary directory to store a file - string aTmpDir = ""; + /*string aTmpDir = ""; char *Tmp_dir = getenv("SALOME_TMP_DIR"); if(Tmp_dir != NULL) { @@ -122,7 +124,7 @@ std::string SALOMEDS_Tool::GetTmpDir() mkdir(aDir.c_str(), 0x1ff); #endif - return aDir; + return aDir;*/ } //============================================================================ @@ -151,7 +153,7 @@ void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory, if(IsDirDeleted) { if(Exists(aDirName)) { #ifdef WNT - RemoveDirectory(aDireName.c_str()); + RemoveDirectory(aDirName.c_str()); #else rmdir(aDirName.c_str()); #endif @@ -408,7 +410,7 @@ std::string SALOMEDS_Tool::GetDirFromPath(const std::string& thePath) { } #ifdef WNT //Check if the only disk letter is given as path - if(path.size() == 2 && path[1] == ":") path +='\\'; + if(path.size() == 2 && path[1] == ':') path +='\\'; #endif for(int i = 0, len = path.size(); i #endif using namespace std; + //int gethostname(char *name, size_t len); std::string GetHostname() @@ -76,3 +77,170 @@ std::string GetHostname() return p; } + +std::string OpUtil_Dir::GetTmpDirByEnv( const std::string& tmp_path_env ) +{ + string dir; + char* val = getenv( tmp_path_env.c_str() ); + val ? dir = string( val ) : ""; + return GetTmpDirByPath( dir ); +} + +std::string OpUtil_Dir::GetTmpDirByPath( const std::string& tmp_path ) +{ + string aTmpDir = tmp_path; + char sep = +#ifdef WNT + '\\'; +#else + '/'; +#endif + /*if ( tmp_path.length() > 0 ) + { + char *Tmp_dir = getenv(tmp_path_env.c_str()); + if( Tmp_dir != NULL ) + { + aTmpDir = string(Tmp_dir); + if(aTmpDir[aTmpDir.size()-1] != sep) + aTmpDir+=sep; + } + }*/ + if ( aTmpDir == "" ) + { +#ifdef WNT + char *Tmp_dir = getenv("TEMP"); + if( Tmp_dir == NULL ) + { + Tmp_dir = getenv("TMP"); + if (Tmp_dir == NULL) + aTmpDir = string("C:\\"); + else + aTmpDir = string(Tmp_dir); + } + else + aTmpDir = string(Tmp_dir); +#else + aTmpDir = string("/tmp/"); +#endif + } + + if(aTmpDir[aTmpDir.size()-1] != sep) + aTmpDir+=sep; + + srand((unsigned int)time(NULL)); + int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory + char buffer[127]; + sprintf(buffer, "%d", aRND); + string aSubDir(buffer); + if(aSubDir.size() <= 1) aSubDir = string("123409876"); + + aTmpDir += aSubDir; //Get RND sub directory + + string aDir = aTmpDir; + + if(IsExists(aDir)) { + for(aRND = 0; IsExists(aDir); aRND++) { + sprintf(buffer, "%d", aRND); + aDir = aTmpDir+buffer; //Build a unique directory name + } + } + + if(aDir[aDir.size()-1] != sep) aDir+=sep; + +#ifdef WNT + CreateDirectory(aDir.c_str(), NULL); +#else + mkdir(aDir.c_str(), 0x1ff); +#endif + + return aDir; +} + +//============================================================================ +// function : GetTempDir +// purpose : Return a temp directory to store created files like "/tmp/sub_dir/" +//============================================================================ +std::string OpUtil_Dir::GetTmpDir() +{ + return GetTmpDirByPath( "" ); + //Find a temporary directory to store a file +/* + string aTmpDir = ""; + char sep = +#ifdef WNT + '\\'; +#else + '/'; +#endif + if ( tmp_path_env.length() > 0 ) + { + char *Tmp_dir = getenv(tmp_path_env.c_str()); + if( Tmp_dir != NULL ) + { + aTmpDir = string(Tmp_dir); + if(aTmpDir[aTmpDir.size()-1] != sep) + aTmpDir+=sep; + } + } + if ( aTmpDir == "" ) + { +#ifdef WNT + char *Tmp_dir = getenv("TEMP"); + if( Tmp_dir == NULL ) + { + Tmp_dir = getenv("TMP"); + if (Tmp_dir == NULL) + aTmpDir = string("C:\\"); + else + aTmpDir = string(Tmp_dir); + } + else + aTmpDir = string(Tmp_dir); +#else + aTmpDir = string("/tmp/"); +#endif + } + + srand((unsigned int)time(NULL)); + int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory + char buffer[127]; + sprintf(buffer, "%d", aRND); + string aSubDir(buffer); + if(aSubDir.size() <= 1) aSubDir = string("123409876"); + + aTmpDir += aSubDir; //Get RND sub directory + + string aDir = aTmpDir; + + if(Exists(aDir)) { + for(aRND = 0; Exists(aDir); aRND++) { + sprintf(buffer, "%d", aRND); + aDir = aTmpDir+buffer; //Build a unique directory name + } + } + + if(aDir[aDir.size()-1] != sep) aDir+=sep; + +#ifdef WNT + CreateDirectory(aDir.c_str(), NULL); +#else + mkdir(aDir.c_str(), 0x1ff); +#endif + + return aDir;*/ +} + +bool OpUtil_Dir::IsExists(const string& thePath) +{ +#ifdef WNT + if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { + if ( GetLastError () == ERROR_FILE_NOT_FOUND ) { + return false; + } + } +#else + int status = access ( thePath.c_str() , F_OK ); + if (status != 0) return false; +#endif + return true; +} \ No newline at end of file diff --git a/src/Utils/OpUtil.hxx b/src/Utils/OpUtil.hxx index ba5d5eb42..f462726a4 100644 --- a/src/Utils/OpUtil.hxx +++ b/src/Utils/OpUtil.hxx @@ -34,4 +34,24 @@ UTILS_EXPORT std::string GetHostname(); UTILS_EXPORT const char *duplicate(const char * const); +class UTILS_EXPORT OpUtil_Dir +{ +public: + // Returns the unique temporary directory, that is defined in tmp_path_env if this variable is set + // otherwise return /tmp/something/ for Unix or c:\something\ for WNT + static std::string GetTmpDirByEnv( const std::string& tmp_path_env ); + + // Returns the unique temporary directory, that is defined in tmp_path if this variable is set + // otherwise return /tmp/something/ for Unix or c:\something\ for WNT + static std::string GetTmpDirByPath( const std::string& tmp_path ); + + // Returns the unique temporary directory in + // /tmp/something/ for Unix or c:\something\ for WNT + static std::string GetTmpDir(); + + // Returns True(False) if the path (not)exists + static bool IsExists( const std::string& path ); + +}; + #endif -- 2.39.2