Salome HOME
Memory leaks
[modules/kernel.git] / idl / SALOME_PyNode.idl
index d33636ce7b473d4abb9976285499f6cf5d7c4532..19ff0f2cbd5af067d9197ae330a9e8067f758a40 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  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
 // 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
@@ -38,21 +38,41 @@ module Engines
   typedef sequence<octet> pickledArgs;
   typedef sequence<string> listofstring;
 
-  interface PyNode : SALOME::GenericObj
+  interface PyNodeBase : SALOME::GenericObj
   {
+    /*!
+      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