Salome HOME
Sphinx portability
[modules/yacs.git] / idl / SALOME_Component.idl
index 9d55e154be208f748d5bf1ae95028f4479bf6f42..0edd03005d7a0bdefbf010b970bf4620906ef8b2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // 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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -40,12 +40,12 @@ component in %SALOME application.
 */
 module Engines
 {
-  /*! 
+  /*!
     A byte stream which is used for binary data transfer between different
     components
   */
-  typedef sequence<octet> TMPFile;  
-  
+  typedef sequence<octet> TMPFile;
+
   //!  General Key Value Structure to set or get properties, for component
   struct KeyValuePair
   {
@@ -53,7 +53,7 @@ module Engines
     any value;
   };
 
-  //!  Structure data type to hold reference on data 
+  //!  Structure data type to hold reference on data
   struct dataref
   {
     string ref;
@@ -90,20 +90,35 @@ module Engines
       \param componentName Name of the component which will be registered
                            in Registry and Name Service,
                          (instance number suffix added to the registered name)
-      \param studyId        0 if instance is not associated to a study, 
+      \param studyId        0 if instance is not associated to a study,
                             >0 otherwise (== study id)
       \return a loaded component
     */
     Engines::EngineComponent create_component_instance(in string componentName,
                                                        in long studyId);
 
+    //! Create a new Python servant instance of a generic service.
+        /*!
+          This simply loads the service in the current container by importing the
+          corresponding Python module.
+          Warning: no internal registration is done, so it is up to the caller to
+          manage the various instanciation.
+          \param serviceName Name of the service
+
+                                >0 otherwise (== study id)
+          \param reason  in case of error (return void string) a string explaining the error
+          \return the IOR of the loaded service.
+        */
+    string create_python_service_instance(in string serviceName,
+                                          out string reason);
+
     //! Create a new servant instance of a component with environment variables specified.
     /*!
       Component library must be loaded.
       \param componentName Name of the component which will be registered
                            in Registry and Name Service,
                          (instance number suffix added to the registered name)
-      \param studyId        0 if instance is not associated to a study, 
+      \param studyId        0 if instance is not associated to a study,
                             >0 otherwise (== study id)
       \param env         a dict of env variables
       \param reason      in case of error (return nil) a string explaining the error
@@ -116,7 +131,7 @@ module Engines
     /*!
       \param registeredName  Name of the component in Registry or Name Service,
                              without instance suffix number
-      \param studyId        0 if instance is not associated to a study, 
+      \param studyId        0 if instance is not associated to a study,
                             >0 otherwise (== study id)
       \return the first instance found with same studyId
     */
@@ -142,7 +157,7 @@ module Engines
     */
     void remove_impl(in EngineComponent component_i);
 
-    //!  Unload component libraries from the container. 
+    //!  Unload component libraries from the container.
     void finalize_removal() ;
 
     //!  Determines whether the server has been loaded or not.
@@ -166,7 +181,7 @@ module Engines
     //!  Returns the PID of the container
     long getPID();
 
-    //! Kill the container 
+    //! Kill the container
     /*!
       Returns True if the %container has been killed.
       Kept for Superv compilation but can't work, unless oneway...
@@ -178,7 +193,7 @@ module Engines
     /*!
       returns a fileRef object if origFileName exists and is readable
       else returns null object. Only one fileRef is created for a given
-      file name, so, several calls with the same file name returns the 
+      file name, so, several calls with the same file name returns the
       same object.
     */
     fileRef createFileRef(in string origFileName);
@@ -186,7 +201,7 @@ module Engines
     //! Create a Salome_file
     /*!
       returns a Salome_file object if origFileName exists and is readable
-      else returns null object. 
+      else returns null object.
 
       \param origFileName name of the file to be managed (can contain the path).
 
@@ -217,12 +232,18 @@ module Engines
      */
     PyNode createPyNode(in string nodeName, in string code)  raises(SALOME::SALOME_Exception);
 
+    //! Retrieves the last created PyNode instance with createPyNode.
+    PyNode getDefaultPyNode(in string nodeName);
+
     //! Create a PyScriptNode in the container
     /*!
       \param nodeName the name of the PyScriptNode
       \param code python code as text to load in the node
      */
     PyScriptNode createPyScriptNode(in string nodeName, in string code)  raises(SALOME::SALOME_Exception);
+
+    //! Retrieves the last created PyScriptNode instance with createPyScriptNode.
+    PyScriptNode getDefaultPyScriptNode(in string nodeName);
   };
 
   /*! \brief Interface of the %component.
@@ -262,10 +283,10 @@ module Engines
 
     //! Set component instance properties
     /*!
-      Gives a sequence of (key=string,value=any) to the component. 
+      Gives a sequence of (key=string,value=any) to the component.
       Base class component stores the sequence in a map.
       The map is cleared before.
-      This map is for use by derived classes. 
+      This map is for use by derived classes.
     */
     void setProperties(in FieldsDict dico);
 
@@ -325,21 +346,21 @@ module Engines
 
     //! Get the cpu used
     /*!
-      Returns the Cpu used 
+      Returns the Cpu used
     */
     long CpuUsed_impl() ;
-    
+
     //! Get a python dump
     /*!
       Returns a python script, which is being played back reproduces
       the data model of component
-    */    
+    */
     TMPFile DumpPython(in Object theStudy,
                        in boolean isPublished,
                        in boolean isMultiFile,
                        out boolean isValidScript);
 
-    
+
     //! Returns a CORBA Ref of a input Salome_file managed by a service.
     /*!
 
@@ -348,21 +369,21 @@ module Engines
 
       \return CORBA Ref of the requested file.
 
-      \exception contains informations of what if the component cannot 
+      \exception contains informations of what if the component cannot
       sends the file's reference.
     */
-    Engines::Salome_file getInputFileToService(in string service_name, 
+    Engines::Salome_file getInputFileToService(in string service_name,
                                                in string Salome_file_name) raises(SALOME::SALOME_Exception);
 
-    //! Check service input files (transfer them if needed) 
+    //! Check service input files (transfer them if needed)
     /*!
       This method is used before the activation of the service. It calls
-      recvFiles() on all the input Salome_file files of the service. 
-      
+      recvFiles() on all the input Salome_file files of the service.
+
       Before each recvFiles(), it uses the callback method named configureSalome_file.
       This method allows the user to configure the files managed by the Salome_file.
 
-      By default, there is no files managed when a Salome_file is created, 
+      By default, there is no files managed when a Salome_file is created,
       but the supervisor set some files managed by the Salome_file from the information contained
       into the schema file.
 
@@ -394,21 +415,21 @@ module Engines
 
       \return CORBA Ref of the requested file.
 
-      \exception contains informations of what if the component cannot 
+      \exception contains informations of what if the component cannot
       sends the file's reference.
     */
-    Engines::Salome_file getOutputFileToService(in string service_name, 
+    Engines::Salome_file getOutputFileToService(in string service_name,
                                                 in string Salome_file_name) raises(SALOME::SALOME_Exception);
 
-    //! Check service output files (transfer them if needed) 
+    //! Check service output files (transfer them if needed)
     /*!
       This method is used at the end of the service. It calls
-      recvFiles() on all the output Salome_file files of the service. 
-      
+      recvFiles() on all the output Salome_file files of the service.
+
       Before each recvFiles(), it uses the callback method named configureSalome_file.
       This method allows the user to configure the files managed by the Salome_file.
 
-      By default, there is no files managed when a Salome_file is created, 
+      By default, there is no files managed when a Salome_file is created,
       but the supervisor set some files managed by the Salome_file from the information contained
       into the schema file.
 
@@ -439,21 +460,32 @@ module Engines
       component provides such information.
     */
     boolean hasObjectInfo();
-    
+
     //! Get custom information about the given object.
     /*!
       This method is used to get the custom information about the given object.
       Should be redefined in the certain component in case of this
       component provides such information.
       It is worth using this method only if hasObjectInfo() method returns true.
-      
+
       \param entry object's entry.
       \param studyId study id
 
       \return an information about the given object.
     */
     string getObjectInfo(in long studyId, in string entry);
-  } ;
+
+    //! Get version of the component
+    /*!
+      This method is supposed to be implemented in all derived classes; default implementation
+      returns "unknown" string that means that no version information about the component is available.
+      \note The version of the component is stored to the study, as a part of general persistence
+      mechanism; once stored, version information in the study cannot be changed.
+
+      \return string containing component's version, e.g. "1.0"
+    */
+    string getVersion();
+  };
 
   /*!
     \brief Base interface of the %component that supports exporting data.
@@ -493,7 +525,7 @@ module Engines
 
     //! Close the file transfer
     /*!
-    when the file transfer is finished, close method releases structures 
+    when the file transfer is finished, close method releases structures
     created by open method, identified by fileId.
     */
     void close(in long fileId);
@@ -514,16 +546,16 @@ module Engines
 
   };
 
-  //!  A file managed by a Salome_file. 
+  //!  A file managed by a Salome_file.
   struct file {
     //! file name
     string file_name;
     //! path name
-    string path; 
+    string path;
     string type;
     string source_file_name;
     //! status ("present" or "notpresent")
-    string status; 
+    string status;
     long   node;
     Engines::Container container;
   };
@@ -532,16 +564,16 @@ module Engines
   typedef sequence<Engines::file> files;
 
 
-  //!  The state of a Salome_file. 
+  //!  The state of a Salome_file.
   struct SfState {
     //! file name
-    string  name; 
+    string  name;
     //! hdf5 file where the file can be saved
-    string  hdf5_file_name; 
+    string  hdf5_file_name;
     //! number of files managed
-    long    number_of_files; 
+    long    number_of_files;
     //! information if all the files are received
-    boolean files_ok; 
+    boolean files_ok;
 
   };
 
@@ -571,7 +603,7 @@ module Engines
     */
     void save(in string hdf5_file)                            raises (SALOME::SALOME_Exception);
 
-    //!  Save a Salome_file into a hdf5_file. 
+    //!  Save a Salome_file into a hdf5_file.
     /*!
       All files that are managed are saved into the hdf5_file
 
@@ -622,7 +654,7 @@ module Engines
     */
     void connectDistributedFile(in string file_name,
                                 in Engines::Salome_file source_Salome_file) raises (SALOME::SALOME_Exception);
-    
+
     //!  Connect the file_name with a Distributed file_name.
     /*!
 
@@ -696,7 +728,7 @@ module Engines
      machine (refMachine).
      It is created by a container (factoryServer) on refMachine,
      with createFileRef(in string origFileName) method.
-     The fileRef object maintains a list of (machine,filename) for copies. 
+     The fileRef object maintains a list of (machine,filename) for copies.
      If a copy exists on myMachine, getRef(myMachine) returns the file name
      of the copy on myMachine, else returns empy string.
      If there is no copy on myMachine, method getFileTransfer() from container