+
+ /*!
+ \brief Base interface of the %component that supports exporting data.
+ */
+ interface ImportableComponent
+ {
+ /*! \brief Get a list of supported formats */
+ SALOME::StringSeq GetImportableFormats();
+ boolean ImportDataAs(in string format, in SALOME::GenericObj exporter);
+ };
+
+ //! A block of binary data used for file transfer. The maximum size of the block is defined on server side.
+ typedef sequence<octet> fileBlock;
+
+ /*! \brief Interface of fileTransfer.
+ The fileTransfer and fileRef interfaces provide a file transfer service
+ between different computers.
+ */
+ interface fileTransfer : SALOME::GenericObj
+ {
+ //! Open the file transfer
+ /*!
+ open method returns a key (fileId) that identifies the structure
+ (ex: C FILE), associated to the original file on the server.
+ The structure is created by a container for transfer of files availables
+ on the computer which runs the container.
+ Each open gives a unique fileId, to allow concurrent reads of the same
+ File.
+ */
+ long open(in string fileName);
+ //! Open the file transfer in write mode for file fileName
+ /*!
+ \param fileName the file to copy into with putBlock
+ \return the id to use with putBlock
+ */
+ long openW(in string fileName);
+
+ //! Close the file transfer
+ /*!
+ when the file transfer is finished, close method releases structures
+ created by open method, identified by fileId.
+ */
+ void close(in long fileId);
+
+ //! Get a file data block
+ /*!
+ Get successive blocks of octets from the original file.
+ The last block is empty, and identifies the end of file.
+ */
+ fileBlock getBlock(in long fileId);
+
+ //! Put a file data block
+ /*!
+ \param fileId identification of the file obtained by openW
+ \param block a data block to copy into the file identified by fileId
+ */
+ void putBlock(in long fileId, in fileBlock block);
+
+ };
+
+ //! A file managed by a Salome_file.
+ struct file {
+ //! file name
+ string file_name;
+ //! path name
+ string path;
+ string type;
+ string source_file_name;
+ //! status ("present" or "notpresent")
+ string status;
+ long node;
+ Engines::Container container;
+ };
+
+ //! A sequence of Engines::file.
+ typedef sequence<Engines::file> files;
+
+
+ //! The state of a Salome_file.
+ struct SfState {
+ //! file name
+ string name;
+ //! hdf5 file where the file can be saved
+ string hdf5_file_name;
+ //! number of files managed
+ long number_of_files;
+ //! information if all the files are received
+ boolean files_ok;
+
+ };
+
+ /*! \brief Interface of a Salome_file managed
+ This file is independent of a Salome module. It can managed one or more
+ real files. It's useful for parallel files. Currently Salome_file cannot manage
+ two files that have the same name but not the same path.
+ */
+ interface Salome_file : Engines::fileTransfer
+ {
+ //! Load a Salome_file from a hdf5 file.
+ /*!
+
+ \param hdf5_file name (with path) of the hdf5_file.
+
+ \exception contains informations of errors if the loading doesn't succeed.
+ */
+ void load(in string hdf5_file) raises (SALOME::SALOME_Exception);
+
+ //! Save a Salome_file into a hdf5_file.
+ /*!
+
+ \param hdf5_file name (with path) of the hdf5_file.
+
+ \exception contains informations of errors if the save doesn't succeed.
+
+ */
+ void save(in string hdf5_file) raises (SALOME::SALOME_Exception);
+
+ //! Save a Salome_file into a hdf5_file.
+ /*!
+ All files that are managed are saved into the hdf5_file
+
+ \param hdf5_file name (with path) of the hdf5_file.
+
+ \exception contains informations of errors if the save doesn't succeed.
+
+ */
+ void save_all(in string hdf5_file) raises (SALOME::SALOME_Exception);
+
+/**************/
+
+ //! Add a Local file to the Salome_file.
+ /*!
+
+ \param file_name name of the file with the path.
+
+ \exception raised if the file is already added into the Salome_file.
+ */
+ void setLocalFile(in string comp_file_name) raises (SALOME::SALOME_Exception);
+
+ //! Add a Distributed file to the Salome_file.
+ /*!
+
+ \param comp_file_name name of the file with the path.
+
+ \exception raised if the file is already added into the Salome_file.
+ */
+ void setDistributedFile(in string comp_file_name) raises (SALOME::SALOME_Exception);
+
+ //! Connect a Salome_file with another Salome_file.
+ /*!
+ It works only if the Salome_file managed only one file
+
+ \param source_Salome_file Salome_file that managed the distributed version of the file.
+
+ \exception raised if there is more or less than one file.
+ */
+ void connect(in Engines::Salome_file source_Salome_file) raises (SALOME::SALOME_Exception);
+
+ //! Connect the managed file file_name to a Salome_file.
+ /*!
+
+ \param file_name name of the file without the path.
+ \param source_Salome_file Salome_file that managed the distributed version of the file.
+
+ \exception raised if the file doesn't exist.
+ */
+ 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.
+ /*!
+
+ \param file_name name of the file without the path.
+ \param source_file_name It's the name of the file managed by the distributed source Salome_file.
+
+ \exception raised if the file doesn't exist.
+ */
+ void setDistributedSourceFile(in string file_name,
+ in string source_file_name) raises (SALOME::SALOME_Exception);
+
+/**************/
+
+ //! Get all the distributed files managed by the Salome_file and check all the local files.
+ /*!
+
+ \exception raised if some of the files are not ok.
+ */
+ void recvFiles() raises (SALOME::SALOME_Exception) ;
+
+/**************/
+
+ //! Remove a file of the Salome_file.
+ /*!
+
+ \param file_name name of the file.
+
+ \exception raised if the file doesn't exist.
+ */
+ void removeFile(in string file_name) raises (SALOME::SALOME_Exception);
+
+ //! Remove all the files of the Salome_file.
+ void removeFiles();
+
+/**************/
+
+ //! Get the list of the files managed by the Salome_file.
+ /*!
+ The list can be empty.
+ */
+ Engines::files getFilesInfos();
+
+ //! Get a file managed by the Salome_file.
+ /*!
+
+ \param file_name the name of the file.
+
+ \return CORBA file reference.
+
+ \exception raised if the file doesn't exist.
+ */
+ Engines::file getFileInfos(in string file_name) raises (SALOME::SALOME_Exception);
+
+ //! Return the state of the Salome_file.
+ Engines::SfState getSalome_fileState();
+
+
+ //! Set the container where files are.
+ /*!
+
+ \param container container CORBA's reference.
+ */
+ void setContainer(in Engines::Container container);
+ };
+
+ /*! \brief Interface of fileRef.
+ The fileTransfer and fileRef interfaces provide a file transfer service
+ between different computers.
+
+ A fileRef object is associated to an original file (origFileName) on a
+ 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.
+ 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
+ factoryServer on refMachine provides a fileTransfer object dedicated to
+ CORBA file copy.
+ After the copy, addRef(myMachine, localFileNameOnMyMachine) registers
+ the file name of the copy on myMachine.
+ */
+ interface fileRef
+ {
+ //! the original file
+ readonly attribute string origFileName;
+ //! the machine of the original file
+ readonly attribute string refMachine;
+
+ Container getContainer();
+
+ boolean addRef(in string machine,
+ in string fileName);
+
+ string getRef(in string machine);
+ };
+};