-// 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
// 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
*/
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
{
any value;
};
- //! Structure data type to hold reference on data
+ //! Structure data type to hold reference on data
struct dataref
{
string ref;
\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
/*!
\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
*/
*/
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.
//! 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...
/*!
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);
//! 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).
*/
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.
//! 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);
//! 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.
/*!
\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.
\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.
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 string containing component's version, e.g. "1.0"
*/
string getVersion();
- } ;
+ };
/*!
\brief Base interface of the %component that supports exporting data.
//! 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);
};
- //! 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;
};
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;
};
*/
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
*/
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.
/*!
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