X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=idl%2FSALOME_PyNode.idl;h=d4054d40a1bee3c931ac6a27b9c2a1eb1ee7a0d9;hb=0d9bf2d93285a3cb3f792f2872f547157e0ae43c;hp=97c419d3cfdadbaec74d83b347c78a46cc70ca06;hpb=641929d327319a80b4fc6f6157605a21f46413c4;p=modules%2Fkernel.git diff --git a/idl/SALOME_PyNode.idl b/idl/SALOME_PyNode.idl old mode 100755 new mode 100644 index 97c419d3c..d4054d40a --- a/idl/SALOME_PyNode.idl +++ b/idl/SALOME_PyNode.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,7 @@ #include "SALOME_GenericObj.idl" #include "SALOME_Exception.idl" +#include "SALOME_Comm.idl" /*! \file SALOME_PyNode.idl \brief interface for remote python execution */ @@ -37,22 +38,49 @@ module Engines { typedef sequence pickledArgs; typedef sequence listofstring; + interface Container; - interface PyNode : SALOME::GenericObj + interface PyNodeBase : SALOME::GenericObj { + Container getContainer(); + string getCode(); + + string getName(); + + /*! + This method allows to define a new global var called \a varName. This newly created var will be + set to value \a valueOfVar. + */ + void defineNewCustomVar(in string varName, in pickledArgs valueOfVar) raises (SALOME::SALOME_Exception); + + /*! + This method executes the python code in \a codeStr and can append/remove symboles in context to make them available or not for future call of execute on this. + \param [in] codeStr - the python code (without statement) to be executed, that can modify the context initialized at initialization. + */ + void executeAnotherPieceOfCode(in string codeStr) raises (SALOME::SALOME_Exception); + }; + + interface PyNode : PyNodeBase + { /*! \brief execute a python function defined in the node \param functionName the python function defined in the node to execute \param inargs input argument values (tuple,dict) provided as a python pickle \return output argument values (tuple) as a python pickle */ - pickledArgs execute(in string functionName,in pickledArgs inargs) raises (SALOME::SALOME_Exception); + pickledArgs execute(in string functionName, in pickledArgs inargs) raises (SALOME::SALOME_Exception); } ; - interface PyScriptNode : SALOME::GenericObj + interface PyScriptNode : PyNodeBase { + /*! + This method compiles, but NOT EXECUTE, the code \a codeStr. The result of the compiled code will be used then + on execute step. + \param codeStr - the python code (without statement) to be executed, that can modify the context initialized at initialization. + */ + void assignNewCompiledCode(in string codeStr) raises (SALOME::SALOME_Exception); /*! \brief execute a python script defined in the node @@ -62,6 +90,19 @@ module Engines */ pickledArgs execute(in listofstring outargsname, in pickledArgs inargs) raises (SALOME::SALOME_Exception); + /*! \brief first part of whole execute method. This split is to reduce the memory peak. + */ + void executeFirst(in SALOME::SenderByte inargs) raises (SALOME::SALOME_Exception); + + /*! \brief second and last part of execute method. This split is to reduce the memory peak. + */ + SALOME::SenderByteSeq executeSecond(in listofstring outargsname) raises (SALOME::SALOME_Exception); + + pickledArgs getValueOfVarInContext(in string varName) raises (SALOME::SALOME_Exception); + + void assignVarInContext(in string varName, in pickledArgs value) raises (SALOME::SALOME_Exception); + + pickledArgs callMethodOnVarInContext(in string varName, in string methodName, in pickledArgs args) raises (SALOME::SALOME_Exception); } ; };