Salome HOME
copy tag mergefrom_BR_V0_1_CC_Salome_04oct07
[modules/yacs.git] / src / runtime / PythonNode.hxx
index a972f3933cd945d2cac7e45222bcea23bb023347..db28bed06300fd45026161255e99047ec90172c7 100644 (file)
@@ -2,22 +2,44 @@
 #ifndef _PYTHONNODE_HXX_
 #define _PYTHONNODE_HXX_
 
-#include "ElementaryNode.hxx"
+#include "InlineNode.hxx"
+#include <Python.h>
 
 namespace YACS
 {
   namespace ENGINE
   {
-    
-    class PythonNode: public ElementaryNode 
+    class PythonNode : public InlineNode 
     {
+    protected:
+      Node *simpleClone(ComposedNode *father, bool editionOnly) const;
     public:
+      PythonNode(const PythonNode& other, ComposedNode *father);
       PythonNode(const std::string& name);
+      virtual ~PythonNode();
       virtual void execute();
-      virtual void set_script(const std::string& script);
+      virtual void load();
+      PythonNode* cloneNode(const std::string& name);
+      static const char KIND[];
+      static const char IMPL_NAME[];
+    protected:
+      PyObject* _context;
+    };
 
+    class PyFuncNode : public InlineFuncNode 
+    {
+    protected:
+      Node *simpleClone(ComposedNode *father, bool editionOnly) const;
+    public:
+      PyFuncNode(const PyFuncNode& other, ComposedNode *father);
+      PyFuncNode(const std::string& name);
+      virtual ~PyFuncNode();
+      virtual void execute();
+      virtual void load();
+      PyFuncNode* cloneNode(const std::string& name);
     protected:
-      std::string _script;
+      PyObject* _context;
+      PyObject* _pyfunc;
     };
   }
 }