Back to index

salome-kernel  6.5.0
SALOME_Component.idl
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //  File   : SALOME_Component.idl
00023 //  Author : Paul RASCLE, EDF
00024 
00025 #ifndef _SALOME_COMPONENT_IDL_
00026 #define _SALOME_COMPONENT_IDL_
00027 
00028 #include "SALOME_GenericObj.idl"
00029 #include "SALOMEDS.idl"
00030 #include "SALOME_Exception.idl"
00031 #include "SALOME_PyNode.idl"
00032 
00041 module Engines
00042 {
00047   typedef sequence<octet> TMPFile;  
00048   
00050   struct KeyValuePair
00051   {
00052     string key;
00053     any value;
00054   };
00055 
00057   struct dataref
00058   {
00059     string ref;
00060   };
00061 
00062   typedef sequence<KeyValuePair> FieldsDict;
00063 
00064   interface EngineComponent ;
00065   interface fileRef ;
00066   interface fileTransfer ;
00067   interface Salome_file;
00068 
00074   interface Container
00075   {
00076 
00085     boolean load_component_Library(in string componentName, out string reason);
00086 
00088 
00097     Engines::EngineComponent create_component_instance(in string componentName,
00098                                                        in long studyId);
00099 
00101 
00112     Engines::EngineComponent create_component_instance_env(in string componentName,
00113                                                            in long studyId, in FieldsDict env,
00114                                                            out string reason);
00116 
00123     EngineComponent find_component_instance(in string registeredName,
00124                                             in long studyId);
00125 
00127 
00136     EngineComponent load_impl(in string nameToRegister,
00137                               in string componentName);
00138 
00140 
00143     void remove_impl(in EngineComponent component_i);
00144 
00146     void finalize_removal() ;
00147 
00149     void ping();
00150 
00152     readonly attribute string name ;
00153 
00155     readonly attribute string workingdir ;
00156 
00158     attribute string logfilename ;
00159 
00161     void Shutdown();
00162 
00164     string getHostName();
00165 
00167     long getPID();
00168 
00170 
00175     boolean Kill_impl() ;
00176 
00178 
00184     fileRef createFileRef(in string origFileName);
00185 
00187 
00195     Salome_file createSalome_file(in string origFileName);
00196 
00198 
00203     fileTransfer getFileTransfer();
00204 
00206 
00211     void copyFile(in Container contai, in string remoteFile, in string localFile);
00212 
00214 
00218     PyNode createPyNode(in string nodeName, in string code)  raises(SALOME::SALOME_Exception);
00219 
00221 
00225     PyScriptNode createPyScriptNode(in string nodeName, in string code)  raises(SALOME::SALOME_Exception);
00226   };
00227 
00232   interface EngineComponent
00233   {
00235     readonly attribute string instanceName ;
00236 
00238     readonly attribute string interfaceName ;
00239 
00241     void ping();
00242 
00244 
00250     long getStudyId();
00251 
00253 
00258     void destroy() ;
00259 
00261     Container GetContainerRef() ;
00262 
00264 
00270     void setProperties(in FieldsDict dico);
00271 
00273 
00277     FieldsDict getProperties();
00278 
00280 
00283     void SetOption(in string optionName, in string value);
00284 
00286 
00289     string GetOption(in string optionName);
00290 
00292 
00298     void Names( in string aGraphName , in string aNodeName ) ;
00299 
00301 
00304     boolean Kill_impl() ;
00305 
00307 
00311     boolean Stop_impl() ;
00312 
00314 
00318     boolean Suspend_impl() ;
00319 
00321 
00324     boolean Resume_impl() ;
00325 
00327 
00330     long CpuUsed_impl() ;
00331     
00333 
00337     TMPFile DumpPython(in Object theStudy,
00338                        in boolean isPublished,
00339                        in boolean isMultiFile,
00340                        out boolean isValidScript);
00341 
00342     
00344 
00354     Engines::Salome_file getInputFileToService(in string service_name, 
00355                                                in string Salome_file_name) raises(SALOME::SALOME_Exception);
00356 
00358 
00373     void checkInputFilesToService(in string service_name)           raises(SALOME::SALOME_Exception);
00374 
00376 
00386     Engines::Salome_file setInputFileToService(in string service_name,
00387                                                in string Salome_file_name)   raises(SALOME::SALOME_Exception);
00388 
00390 
00400     Engines::Salome_file getOutputFileToService(in string service_name, 
00401                                                 in string Salome_file_name) raises(SALOME::SALOME_Exception);
00402 
00404 
00419     void checkOutputFilesToService(in string service_name)        raises(SALOME::SALOME_Exception);
00420 
00422 
00432     Engines::Salome_file setOutputFileToService(in string service_name,
00433                                                 in string Salome_file_name)  raises(SALOME::SALOME_Exception);
00434 
00436 
00441     boolean hasObjectInfo();
00442     
00444 
00455     string getObjectInfo(in long studyId, in string entry);
00456   } ;
00457 
00461   interface ImportableComponent
00462   {
00464     SALOME::StringSeq GetImportableFormats();
00465     boolean           ImportDataAs(in string format, in SALOME::GenericObj exporter);
00466   };
00467 
00469   typedef sequence<octet> fileBlock;
00470 
00475   interface fileTransfer : SALOME::GenericObj
00476   {
00478 
00486     long open(in string fileName);
00488 
00492     long openW(in string fileName);
00493 
00495 
00499     void close(in long fileId);
00500 
00502 
00506     fileBlock getBlock(in long fileId);
00507 
00509 
00513     void putBlock(in long fileId, in fileBlock block);
00514 
00515   };
00516 
00518   struct file {
00520     string file_name;
00522     string path; 
00523     string type;
00524     string source_file_name;
00526     string status; 
00527     long   node;
00528     Engines::Container container;
00529   };
00530 
00532   typedef sequence<Engines::file> files;
00533 
00534 
00536   struct SfState {
00538     string  name; 
00540     string  hdf5_file_name; 
00542     long    number_of_files; 
00544     boolean files_ok; 
00545 
00546   };
00547 
00553   interface Salome_file : Engines::fileTransfer
00554   {
00556 
00562     void load(in string hdf5_file)                            raises (SALOME::SALOME_Exception);
00563 
00565 
00572     void save(in string hdf5_file)                            raises (SALOME::SALOME_Exception);
00573 
00575 
00583     void save_all(in string hdf5_file)                            raises (SALOME::SALOME_Exception);
00584 
00585 /**************/
00586 
00588 
00594     void setLocalFile(in string comp_file_name) raises (SALOME::SALOME_Exception);
00595 
00597 
00603     void setDistributedFile(in string comp_file_name) raises (SALOME::SALOME_Exception);
00604 
00606 
00613     void connect(in Engines::Salome_file source_Salome_file) raises (SALOME::SALOME_Exception);
00614 
00616 
00623     void connectDistributedFile(in string file_name,
00624                                 in Engines::Salome_file source_Salome_file) raises (SALOME::SALOME_Exception);
00625     
00627 
00634     void setDistributedSourceFile(in string file_name,
00635                                   in string source_file_name) raises (SALOME::SALOME_Exception);
00636 
00637 /**************/
00638 
00640 
00644     void recvFiles()                                            raises (SALOME::SALOME_Exception) ;
00645 
00646 /**************/
00647 
00649 
00655     void removeFile(in string file_name)                    raises (SALOME::SALOME_Exception);
00656 
00658     void removeFiles();
00659 
00660 /**************/
00661 
00663 
00666     Engines::files getFilesInfos();
00667 
00669 
00677     Engines::file  getFileInfos(in string file_name) raises (SALOME::SALOME_Exception);
00678 
00680     Engines::SfState getSalome_fileState();
00681 
00682 
00684 
00688     void setContainer(in Engines::Container container);
00689   };
00690 
00708   interface fileRef
00709   {
00711     readonly attribute string origFileName;
00713     readonly attribute string refMachine;
00714 
00715     Container getContainer();
00716 
00717     boolean addRef(in string machine,
00718                    in string fileName);
00719 
00720     string getRef(in string machine);
00721   };
00722 };
00723 
00724 #endif