Salome HOME
Delete multi-study related code
authormpa <mpa@opencascade.com>
Tue, 17 Jan 2017 09:14:56 +0000 (12:14 +0300)
committermpa <mpa@opencascade.com>
Tue, 17 Jan 2017 09:14:56 +0000 (12:14 +0300)
20 files changed:
bin/runIDLparser
idl/SALOMEDS.idl
idl/SALOME_ModuleCatalog.idl
idl/SALOME_Session.idl
resources/KERNELCatalog.xml.in
src/Container/Component_i.cxx
src/Container/SALOME_Component_i.hxx
src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.hxx
src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_Handler.hxx
src/ModuleCatalog/SALOME_ModuleCatalog_Parser.hxx
src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx
src/ModuleGenerator/IDLparser.py
src/ParallelContainer/SALOME_ParallelComponent_i.cxx
src/ParallelContainer/SALOME_ParallelComponent_i.hxx
src/TOOLSDS/SALOMEDS_Tool.cxx
src/TOOLSDS/SALOMEDS_Tool.hxx

index c13e39b12f915193f3a7a2c5909e8f4b1cb23824..f3c8df9f13d4dbdfb72969ebc20c4ef4db29a8fc 100644 (file)
@@ -43,7 +43,7 @@ if test "$hh" = "1" ; then
     echo ""
     echo "   to run IDLparser:"
     echo ""
-    echo "        $0 -Wbcatalog=<my_catalog.xml>[,icon=<pngfile>][,version=<num>][,author=<name>][,name=<component_name>][,multistudy=<component_multistudy>][,remove=component_name] <file.idl>   "
+    echo "        $0 -Wbcatalog=<my_catalog.xml>[,icon=<pngfile>][,version=<num>][,author=<name>][,name=<component_name>][,remove=component_name] <file.idl>   "
     echo ""
     echo "   to have omniidl help:"
     echo ""
index e300df269ba3ac9609ed4fddc84a9c3ef5453b17..d43d58e835897ed3017d7cf0cde8cda65b17faad 100644 (file)
@@ -55,8 +55,6 @@ module SALOMEDS
 */
   typedef string SalomeReference;
 
-//! List of file names
-  typedef sequence<string> ListOfFileNames;
 //! List of modification dates of a study
   typedef sequence<string> ListOfDates ;
 //! An unbounded sequence of strings
index 78439ffe3cf166d01e9886887ac4b4aa4cd569a0..9aa6c61644b3f41ad99732f74152b400b8b83271 100644 (file)
@@ -166,7 +166,6 @@ a path to a component
     ComponentType      type;
     string             name;
     string             username;
-    boolean            multistudy;
     ImplType           implementationType;
     string             implname;
     string             icon;
@@ -269,10 +268,6 @@ a path to a component
 */
     readonly attribute string componentusername;
 
-/*!  \brief Get whether the component is multistudy or not
-*/
-    readonly attribute boolean multistudy;
-
 /*!  \brief Get the type of the component
 */
     readonly attribute ComponentType component_type ;
index 8f195744698d354477fb423739d495847504402e..fc26d2d4741ffe9003d5bee29cd023a9af9e5045 100644 (file)
@@ -54,8 +54,7 @@ module SALOME
         -# running : one or more running studies
 */
     SessionState state ;
-    //! Number of running studies
-    short        runningStudies ;
+
     //! It is True if GUI is active in the session
     boolean      activeGUI ;
   } ;
@@ -70,8 +69,8 @@ module SALOME
   {
 //!  This exception is raised when trying to stop the %session with active GUI
     exception GUIActive {} ;
-//!  This exception is raised when trying to stop the %session with a number of running studies.
-    exception RunningStudies {} ;
+//!  This exception is raised when trying to stop the %session with running study.
+    exception RunningStudy {} ;
 
 //!  Launches GUI in the session
     void GetInterface();
@@ -80,7 +79,7 @@ module SALOME
     Engines::EngineComponent GetComponent(in string theLibraryName);
 
 //!  Stops the %Session (It must be idle)
-    void StopSession() raises(GUIActive, RunningStudies) ;
+    void StopSession() raises(GUIActive, RunningStudy) ;
 
 //!  Gets Session State
     StatSession GetStatSession() ;
index 5648c41fda83d0965b2bc2d63a7a2277424d061d..3a87aaddedbe4b74ad3bf86eab75d81d8c76e05c 100644 (file)
@@ -77,7 +77,6 @@
                <component-author>NRI</component-author>
                <component-version>@SALOMEKERNEL_VERSION@</component-version>
                <component-comment>GUI Neutral Context</component-comment>
-               <component-multistudy>1</component-multistudy>
 
        <constraint>hostname = muna</constraint>
        </component>
@@ -88,7 +87,6 @@
                <component-author>NRI</component-author>
                <component-version>@SALOMEKERNEL_VERSION@</component-version>
                <component-comment>GUI Neutral Context</component-comment>
-               <component-multistudy>1</component-multistudy>
                <constraint>'linux' ~ OS</constraint>
        </component>
        <component>
@@ -98,7 +96,6 @@
                <component-author>NRI</component-author>
                <component-version>@SALOMEKERNEL_VERSION@</component-version>
                <component-comment>GUI Neutral Context</component-comment>
-               <component-multistudy>1</component-multistudy>
                <constraint>'linux' ~ OS</constraint>
        </component>
 </component-list>
index 6b4676f05d313009b87bb505dfbee41639713ac3..7dda9bdabac0bf525602b68cda3d881caf6c635b 100644 (file)
@@ -51,7 +51,6 @@ int SIGUSR11 = 1000;
 extern bool _Sleeping ;
 static Engines_Component_i * theEngines_Component ;
 
-bool Engines_Component_i::_isMultiStudy = false;
 bool Engines_Component_i::_isMultiInstance = false;
 
 /*! \class Engines_Component_i
index ca1f7cf4f3a546432f2b1b252f8b33fa27fe12e9..4235f5048ac3a50568355fec98c0d46a3b2a51cd 100644 (file)
@@ -128,7 +128,6 @@ public:
   std::string getContainerName();
   void setContainerName();
 
-  static bool isMultiStudy();
   static bool isMultiInstance();
   static std::string GetDynLibraryName(const char *componentName);
 
@@ -147,7 +146,6 @@ public:
                                     Salome_file_i * file);
 
 protected:
-  static bool _isMultiStudy;
   static bool _isMultiInstance;
 
   std::string _instanceName ;
index 9d8408d8610b3ca3c42dde3da98071a2b46e8865..240d60a8a4035e94cacb9694ae1c57f7af9717ef 100644 (file)
@@ -42,8 +42,7 @@ static int MYDEBUG = 0;
 //----------------------------------------------------------------------
 // Function : SALOME_ModuleCatalog_AcomponentImpl
 // Purpose  : Constructor
-//            Affect the component name, type,icone,  a bool to define 
-//            if it's multistudy or not.
+//            Affect the component name, type,icone
 //            Affect too the constraint and the interfaces of the component
 //            and the pathes prefixes for all computers
 //----------------------------------------------------------------------  
@@ -399,16 +398,6 @@ char* SALOME_ModuleCatalog_AcomponentImpl::componentusername()
   return CORBA::string_dup(_Component.username);
 }
 
-//----------------------------------------------------------------------
-// Function : multistudy
-// Purpose  : define if a component can be multistudy or not
-//----------------------------------------------------------------------
-CORBA::Boolean SALOME_ModuleCatalog_AcomponentImpl::multistudy()
-{
-  return _Component.multistudy ;
-}
-
-
 //----------------------------------------------------------------------
 // Function : implementation type
 // Purpose  : return the implementation type :  C++ (dyn lib), Python (module) or executable
index 5078c95f4d2da6cdf3424a4371be6dc3a76526e3..d84bd08daa5ba611f397b3031f13c2477b92778a 100644 (file)
@@ -121,12 +121,6 @@ public:
   */
   virtual char* componentusername();
 
-  //! method to define if a component can be multistudy or not
-  /*!
-    \return true if the component supports multistudy
-  */
-  virtual CORBA::Boolean multistudy();
-
   //! method to define the type of the component
   /*!
     \return the component type
index 8ed79652e0005184dc932037b24ceea718c1df41..858cc45a75b3f261ad3101876fdc0fd12edf97a5 100644 (file)
@@ -152,7 +152,6 @@ int main(int argc,char **argv)
 void PrintComponent(SALOME_ModuleCatalog::Acomponent_ptr C)
 {
   MESSAGE("Name : " <<  C->componentname());
-  MESSAGE("Type : " << C->component_type() << " multistudy : " << C->multistudy());
   MESSAGE("Constraint : " << C->constraint());
   MESSAGE("Icon : " << C->component_icone());
 
index 32f628deee0296499bcdf95deafd96e0ff680911..bc7206822877a273e03e0d71d8412ffa008e6d14 100644 (file)
@@ -64,7 +64,6 @@ SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler(ParserPathPrefixes& p
   test_component_name       = "component-name";
   test_component_username   = "component-username";
   test_component_type       = "component-type" ;
-  test_component_multistudy = "component-multistudy";
   test_component_icon       = "component-icone" ;
   test_component_impltype   = "component-impltype";
   test_component_implname   = "component-implname";
@@ -477,10 +476,6 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
               _aModule.type = OTHER ;
           }
 
-          // Tag test_component_multistudy
-          if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) )
-            _aModule.multistudy = atoi( aContent.c_str() ) != 0;
-
           // Tag test_component_impltype
           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) )
             _aModule.implementationType = aContent;
index f75ca4ae24e6cba2c3e2ccf75f692c83aa4f3f29..1ad92fab99ee5a1fb783e75f6db2fbaef32881b5 100644 (file)
@@ -65,7 +65,6 @@ private:
   const char *test_component_name;
   const char *test_component_username;
   const char *test_component_type ;
-  const char *test_component_multistudy ;
   const char *test_component_icon ;
   const char *test_component_impltype;
   const char *test_component_implname;
index 622af9b9e6661caac71a6dc1486c7db2dd0cf8a8..9f1e4a6cd1dd837db1f65b52b6e80dcab6ff3f25 100644 (file)
@@ -91,7 +91,6 @@ struct ParserComponent
   std::string         name;
   std::string         username;
   ParserComponentType type;
-  bool                multistudy;
   std::string         icon;
   std::string         constraint;
   ParserInterfaces    interfaces;
index 29a9f25c2b3977c48cab6f7605e6e3af8ece632c..26f7c7838ec206c76d0b48823866766a17c22db2 100644 (file)
@@ -124,8 +124,6 @@ std::ostream & operator<< (std::ostream & f,
     << "    name :       " << C.name << std::endl;
   f << "    user name :  " << C.username << std::endl;
   f << "    type :       " << C.type << std::endl;
-  f << "    multistudy : " << (C.multistudy ? "yes" : "no")
-    << std::endl;
   f << "    icon :       " << C.icon << std::endl;
   f << "    constraint : " << C.constraint << std::endl;
 
index 08ab85a2bd424d2d78909152d8c8cf032791f7d1..b3f6e16f0e7791d329293f8d24ddb83cb7c1ecec 100644 (file)
@@ -897,7 +897,6 @@ void SALOME_ModuleCatalogImpl::Private::duplicate
 {
   C_corba.name = CORBA::string_dup(C_parser.name.c_str());
   C_corba.username = CORBA::string_dup(C_parser.username.c_str());
-  C_corba.multistudy = C_parser.multistudy;
   C_corba.icon = CORBA::string_dup(C_parser.icon.c_str());
   C_corba.type = ComponentTypeConvert[C_parser.type];
   if(C_parser.implementationType == "EXE")
index 0f2ab825d22cc68f57ff36b8c9cad02ea9bb32ca..0d6d9a060efe8a3f2a639aafad46825a7b0768de 100644 (file)
@@ -39,7 +39,6 @@ common_data={"AUTHOR"     : "",
              "COMP_TYPE"  : "",
              "COMP_NAME"  : "",
              "COMP_UNAME" : "",
-             "COMP_MULT"  : "",
              "COMP_IMPL"  : ""
              }
 
@@ -437,7 +436,6 @@ class Component(Tree):
         self.addNamedChild('component-author',     common_data["AUTHOR"])
         self.addNamedChild('component-version',    common_data["VERSION"])
         self.addNamedChild('component-comment',    'unknown')
-        self.addNamedChild('component-multistudy', common_data["COMP_MULT"])
         self.addNamedChild('component-impltype',   common_data["COMP_IMPL"])
         self.addNamedChild('component-icone',      common_data["ICON"])
         self.addNamedChild('constraint')
@@ -456,7 +454,7 @@ class Component(Tree):
 
         for i in ['component-username', 'component-author',
                   'component-type', 'component-icone', 'component-version',
-                  'component-multistudy', 'component-impltype', 'constraint']:
+                  'component-impltype', 'constraint']:
             ext = C.getChild(i)
             int = self.getChild(i)
             if int is None:
@@ -833,7 +831,6 @@ def run(tree, args):
     common_data["COMP_NAME"]  = getParamValue("name",       "",                args)
     common_data["COMP_UNAME"] = getParamValue("username",   "",                args)
     common_data["COMP_TYPE"]  = getParamValue("type",       "OTHER",           args)
-    common_data["COMP_MULT"]  = getParamValue("multistudy", "1",               args)
     common_data["COMP_IMPL"]  = getParamValue("impltype",   "1",               args)
 
     print common_data
@@ -882,5 +879,5 @@ def run(tree, args):
 
 if __name__ == "__main__":
     print
-    print "Usage : omniidl -bIDLparser [-I<catalog files directory>]* -Wbcatalog=<my_catalog.xml>[,icon=<pngfile>][,version=<num>][,author=<name>][,name=<component_name>][,username=<component_username>][,multistudy=<component_multistudy>][,impltype=<implementation type : 0 (python), 1 (C++)>] <file.idl>"
+    print "Usage : omniidl -bIDLparser [-I<catalog files directory>]* -Wbcatalog=<my_catalog.xml>[,icon=<pngfile>][,version=<num>][,author=<name>][,name=<component_name>][,username=<component_username>][,impltype=<implementation type : 0 (python), 1 (C++)>] <file.idl>"
     print
index 597ef48cca3d61dce9429d4c056a0c49b4cf5f09..7e7602d7517d92c1a919bb6cf1e9bf3b299bbaf8 100644 (file)
@@ -53,7 +53,6 @@ int SIGUSR11 = 1000;
 extern bool _Sleeping ;
 static Engines_Parallel_Component_i * theEngines_Component ;
 
-bool Engines_Parallel_Component_i::_isMultiStudy = false;
 bool Engines_Parallel_Component_i::_isMultiInstance = false;
 
 //=============================================================================
index 98fe0e9ea96bd7501fee3461340363b2bdd1f860..9ab9b5cb567b01bd2d37111fbcd8680344f4544e 100644 (file)
@@ -121,7 +121,6 @@ public:
   PortableServer::ObjectId * getId(); 
   Engines_Parallel_Container_i *GetContainerPtr();
 
-  static bool isMultiStudy();
   static bool isMultiInstance();
   static std::string GetDynLibraryName(const char *componentName);
 
@@ -143,7 +142,6 @@ public:
                                     Engines::Parallel_Salome_file_proxy_impl * file);
 
 protected:
-  static bool _isMultiStudy;
   static bool _isMultiInstance;
 
   std::string _instanceName ;
index 6b2e467de258a51480f810899059972e53867e01..9f9ffd6b74a608020b7b9cf4371d92fe228a0e7d 100644 (file)
@@ -132,15 +132,14 @@ std::string SALOMEDS_Tool::GetTmpDir()
 // purpose  : Removes files listed in theFileList
 //============================================================================
 void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory, 
-                                         const SALOMEDS::ListOfFileNames& theFiles,
+                                         const std::list<std::string>& theFiles,
                                          const bool IsDirDeleted)
 {
   std::string aDirName = theDirectory;
 
-  int i, aLength = theFiles.length();
-  for(i=1; i<=aLength; i++) {
+  for(std::list<std::string>::const_iterator it = theFiles.begin(); it != theFiles.end(); it++) {
     std::string aFile(aDirName);
-    aFile += theFiles[i-1];
+    aFile += *it;
     if(!Exists(aFile)) continue;
 
 #ifdef WIN32
@@ -170,11 +169,11 @@ namespace
 {
   SALOMEDS::TMPFile* 
   PutFilesToStream(const std::string& theFromDirectory,
-                   const SALOMEDS::ListOfFileNames& theFiles,
-                   const SALOMEDS::ListOfFileNames& theFileNames,
+                   const std::list<std::string>& theFiles,
+                   const std::list<std::string>& theFileNames,
                    const int theNamesOnly)
   {
-    int i, aLength = theFiles.length();
+    int i = 0, aLength = theFiles.size();
     if(aLength == 0)
       return (new SALOMEDS::TMPFile);
     
@@ -190,12 +189,14 @@ namespace
     
     //Determine the required size of the buffer
     
-    for(i=0; i<aLength; i++) {
+    std::list<std::string>::const_iterator it_files = theFiles.begin();
+    std::list<std::string>::const_iterator it_names = theFileNames.begin();
+    for(; it_files != theFiles.end(); it_files++, it_names++, i++) {
       
       //Check if the file exists
       
       if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero
-        std::string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());   
+        std::string aFullPath = aTmpDir + *it_files;
         if(!Exists(aFullPath)) continue;
 #ifdef WIN32
         std::ifstream aFile(aFullPath.c_str(), std::ios::binary);
@@ -206,7 +207,7 @@ namespace
         aFileSize[i] = aFile.tellg();
         aBufferSize += aFileSize[i];              //Add a space to store the file
       }
-      aFileNameSize[i] = strlen(theFileNames[i])+1;
+      aFileNameSize[i] = (*it_names).length()+1;
       aBufferSize += aFileNameSize[i];          //Add a space to store the file name
       aBufferSize += (theNamesOnly)?4:12;       //Add 4 bytes: a length of the file name,
       //    8 bytes: length of the file itself
@@ -227,10 +228,12 @@ namespace
     
     aCurrentPos = 4;
     
-    for(i=0; i<aLength; i++) {
+    it_files = theFiles.begin();
+    it_names = theFileNames.begin();
+    for(; it_files != theFiles.end(); it_files++, it_names++, i++) {
       std::ifstream *aFile;
       if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
-        std::string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+        std::string aFullPath = aTmpDir + *it_files;
         if(!Exists(aFullPath)) continue;
 #ifdef WIN32
         aFile = new std::ifstream(aFullPath.c_str(), std::ios::binary);
@@ -245,7 +248,7 @@ namespace
       aCurrentPos += 4;
       
       //Copy the file name to the buffer
-      memcpy((aBuffer + aCurrentPos), theFileNames[i], aFileNameSize[i]);
+      memcpy((aBuffer + aCurrentPos), (*it_names).c_str(), aFileNameSize[i]);
       aCurrentPos += aFileNameSize[i];
       
       if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly
@@ -277,17 +280,17 @@ namespace
 
 SALOMEDS::TMPFile* 
 SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory,
-                                const SALOMEDS::ListOfFileNames& theFiles,
+                                const std::list<std::string>& theFiles,
                                 const int theNamesOnly)
 {
-  SALOMEDS::ListOfFileNames aFileNames(theFiles);
+  std::list<std::string> aFileNames(theFiles);
   return ::PutFilesToStream(theFromDirectory,theFiles,aFileNames,theNamesOnly);
 }
 
 
 SALOMEDS::TMPFile* 
-SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
-                                const SALOMEDS::ListOfFileNames& theFileNames)
+SALOMEDS_Tool::PutFilesToStream(const std::list<std::string>& theFiles,
+                                const std::list<std::string>& theFileNames)
 {
   return ::PutFilesToStream("",theFiles,theFileNames,0);
 }
@@ -296,12 +299,12 @@ SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
 // function : PutStreamToFile
 // purpose  : converts the stream "theStream" to the files
 //============================================================================
-SALOMEDS::ListOfFileNames_var 
+std::list<std::string>
 SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
                                 const std::string& theToDirectory,
                                 const int theNamesOnly)
 {
-  SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
+  std::list<std::string> aFiles;
 
   if(theStream.length() == 0)
     return aFiles;
@@ -320,8 +323,6 @@ SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
   //Copy the number of files in the stream
   memcpy(&aNbFiles, aBuffer, sizeof(int)); 
 
-  aFiles->length(aNbFiles);
-
   for(i=0; i<aNbFiles; i++) {
 
     //Put a length of the file name to aFileNameSize
@@ -355,7 +356,7 @@ SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
       aFile.close();  
       aCurrentPos += aFileSize;
     }
-    aFiles[i] = CORBA::string_dup(aFileName);
+    aFiles.push_back(CORBA::string_dup(aFileName));
     delete[] aFileName;
   }
 
index eefbe6e0558884e07c99a5ad39cac6e5816b4568..51ee325bf6d80548d73439aab2979950f565ea9d 100644 (file)
@@ -59,22 +59,22 @@ public:
   // Removes files which are in <theDirectory>, the files for deletion are listed in <theFiles>
   // if <IsDirDeleted> is true <theDirectory> is also deleted if it is empty
   static void RemoveTemporaryFiles(const std::string& theDirectory,
-                                   const SALOMEDS::ListOfFileNames& theFiles,
+                                   const std::list<std::string>& theFiles,
                                    const bool IsDirDeleted);
 
   // Converts files listed in <theFiles> which are in <theFromDirectory> into a byte sequence TMPFile
   static SALOMEDS::TMPFile* PutFilesToStream(const std::string& theFromDirectory, 
-                                             const SALOMEDS::ListOfFileNames& theFiles,
+                                             const std::list<std::string>& theFiles,
                                              const int theNamesOnly = 0);
 
   // Converts files listed in <theFiles> which will be named as pointed in the <theFileNames> into a byte sequence TMPFile
-  static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
-                                             const SALOMEDS::ListOfFileNames& theFileNames);
+  static SALOMEDS::TMPFile* PutFilesToStream(const std::list<std::string>& theFiles,
+                                             const std::list<std::string>& theFileNames);
 
   // Converts a byte sequence <theStream> to files and places them in <theToDirectory>
-  static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
-                                                        const std::string& theToDirectory,
-                                                        const int theNamesOnly = 0);
+  static std::list<std::string> PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
+                                                 const std::string& theToDirectory,
+                                                 const int theNamesOnly = 0);
 
   // Returns the name by the path
   // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1"