-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011 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
+// Copyright (C) 2003-2007 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 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.
+// 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
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SALOME_Component.idl
// Author : Paul RASCLE, EDF
-// $Header:
-//
+
#ifndef _SALOME_COMPONENT_IDL_
#define _SALOME_COMPONENT_IDL_
+#include "SALOME_GenericObj.idl"
#include "SALOMEDS.idl"
#include "SALOME_Exception.idl"
+#include "SALOME_PyNode.idl"
-/*! \file SALOME_Component.idl \brief interfaces for Component and Container
+/*! \file SALOME_Component.idl \brief interfaces for EngineComponent and Container
*/
/*! \brief
any value;
};
+ //! Structure data type to hold reference on data
+ struct dataref
+ {
+ string ref;
+ };
+
typedef sequence<KeyValuePair> FieldsDict;
- interface Component ;
+ interface EngineComponent ;
interface fileRef ;
interface fileTransfer ;
interface Salome_file;
\param componentName like COMPONENT, (Python or C++ implementation)
try to make a Python import of COMPONENT,
then a lib open of libCOMPONENTEngine.so
+ \param reason in case of error (return false) a string explaining the error
\return true if load successfull or already done, false otherwise
*/
- boolean load_component_Library(in string componentName);
+ boolean load_component_Library(in string componentName, out string reason);
//! Create a new servant instance of a component.
/*!
>0 otherwise (== study id)
\return a loaded component
*/
- Engines::Component create_component_instance(in string componentName,
- in long studyId);
+ Engines::EngineComponent create_component_instance(in string componentName,
+ in long studyId);
+ //! 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,
+ >0 otherwise (== study id)
+ \param env a dict of env variables
+ \param reason in case of error (return nil) a string explaining the error
+ \return a loaded component
+ */
+ Engines::EngineComponent create_component_instance_env(in string componentName,
+ in long studyId, in FieldsDict env,
+ out string reason);
//! Find a servant instance of a component
/*!
\param registeredName Name of the component in Registry or Name Service,
>0 otherwise (== study id)
\return the first instance found with same studyId
*/
- Component find_component_instance(in string registeredName,
- in long studyId);
+ EngineComponent find_component_instance(in string registeredName,
+ in long studyId);
//! Find a servant instance of a component, or create a new one.
/*!
(not used any more, give empty string)
\return a loaded component
*/
- Component load_impl(in string nameToRegister,
- in string componentName);
+ EngineComponent load_impl(in string nameToRegister,
+ in string componentName);
//! Remove the component servant, and deletes all related objects
/*!
\param component_i Component to be removed
*/
- void remove_impl(in Component component_i);
+ void remove_impl(in EngineComponent component_i);
//! Unload component libraries from the container.
void finalize_removal() ;
\param localFile the local file to create by copy
*/
void copyFile(in Container contai, in string remoteFile, in string localFile);
+
+ //! Create a PyNode in the container
+ /*!
+ \param nodeName the name of the PyNode
+ \param code python code as text to load in the node
+ */
+ PyNode createPyNode(in string nodeName, in string code) raises(SALOME::SALOME_Exception);
+
+ //! 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);
};
/*! \brief Interface of the %component.
This interface is used for interaction between the %container and the
%component and between the components inside the container.
*/
- interface Component
+ interface EngineComponent
{
//! The name of the instance of the %Component
readonly attribute string instanceName ;
the data model of component
*/
TMPFile DumpPython(in Object theStudy,
- in boolean isPublished,
- out boolean isValidScript);
+ in boolean isPublished,
+ in boolean isMultiFile,
+ out boolean isValidScript);
//! Returns a CORBA Ref of a input Salome_file managed by a service.
sends the file's reference.
*/
Engines::Salome_file getInputFileToService(in string service_name,
- in string Salome_file_name) raises(SALOME::SALOME_Exception);
+ in string Salome_file_name) raises(SALOME::SALOME_Exception);
//! Check service input files (transfer them if needed)
/*!
\exception contains informations about files that are not in a good state.
*/
- void checkInputFilesToService(in string service_name) raises(SALOME::SALOME_Exception);
+ void checkInputFilesToService(in string service_name) raises(SALOME::SALOME_Exception);
//! This method adds a input Salome_file to a service of the component.
/*!
a Salome_file with this name for the service.
*/
Engines::Salome_file setInputFileToService(in string service_name,
- in string Salome_file_name) raises(SALOME::SALOME_Exception);
+ in string Salome_file_name) raises(SALOME::SALOME_Exception);
//! Returns a CORBA Ref of a output Salome_file managed by a service.
/*!
sends the file's reference.
*/
Engines::Salome_file getOutputFileToService(in string service_name,
- in string Salome_file_name) raises(SALOME::SALOME_Exception);
+ in string Salome_file_name) raises(SALOME::SALOME_Exception);
//! Check service output files (transfer them if needed)
/*!
\exception contains informations about files that are not in a good state.
*/
- void checkOutputFilesToService(in string service_name) raises(SALOME::SALOME_Exception);
+ void checkOutputFilesToService(in string service_name) raises(SALOME::SALOME_Exception);
//! This method adds an output Salome_file to a service of the component.
/*!
a Salome_file with this name for the service.
*/
Engines::Salome_file setOutputFileToService(in string service_name,
- in string Salome_file_name) raises(SALOME::SALOME_Exception);
+ in string Salome_file_name) raises(SALOME::SALOME_Exception);
//! Indicate if the component instance provides custom information about its objects.
/*!
string getObjectInfo(in long studyId, in string entry);
} ;
+ /*!
+ \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;
The fileTransfer and fileRef interfaces provide a file transfer service
between different computers.
*/
- interface fileTransfer
+ interface fileTransfer : SALOME::GenericObj
{
//! Open the file transfer
/*!
\exception contains informations of errors if the loading doesn't succeed.
*/
- void load(in string hdf5_file) raises (SALOME::SALOME_Exception);
+ void load(in string hdf5_file) raises (SALOME::SALOME_Exception);
//! Save a Salome_file into a hdf5_file.
/*!
\exception contains informations of errors if the save doesn't succeed.
*/
- void save(in string hdf5_file) raises (SALOME::SALOME_Exception);
+ void save(in string hdf5_file) raises (SALOME::SALOME_Exception);
//! Save a Salome_file into a hdf5_file.
/*!
\exception contains informations of errors if the save doesn't succeed.
*/
- void save_all(in string hdf5_file) raises (SALOME::SALOME_Exception);
+ void save_all(in string hdf5_file) raises (SALOME::SALOME_Exception);
/**************/
\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);
+ in Engines::Salome_file source_Salome_file) raises (SALOME::SALOME_Exception);
//! Connect the file_name with a Distributed file_name.
/*!
\exception raised if the file doesn't exist.
*/
void setDistributedSourceFile(in string file_name,
- in string source_file_name) raises (SALOME::SALOME_Exception);
+ in string source_file_name) raises (SALOME::SALOME_Exception);
/**************/
\exception raised if some of the files are not ok.
*/
- void recvFiles() raises (SALOME::SALOME_Exception) ;
+ void recvFiles() raises (SALOME::SALOME_Exception) ;
/**************/
\exception raised if the file doesn't exist.
*/
- void removeFile(in string file_name) raises (SALOME::SALOME_Exception);
+ void removeFile(in string file_name) raises (SALOME::SALOME_Exception);
//! Remove all the files of the Salome_file.
void removeFiles();
\exception raised if the file doesn't exist.
*/
- Engines::file getFileInfos(in string file_name) raises (SALOME::SALOME_Exception);
+ Engines::file getFileInfos(in string file_name) raises (SALOME::SALOME_Exception);
//! Return the state of the Salome_file.
Engines::SfState getSalome_fileState();
Container getContainer();
boolean addRef(in string machine,
- in string fileName);
+ in string fileName);
string getRef(in string machine);
};