Salome HOME
copy tag mergefrom_BR_V0_1_CC_Salome_04oct07
[modules/yacs.git] / src / runtime / SalomePythonNode.hxx
1 #ifndef _SALOMEPYTHONNODE_HXX_
2 #define _SALOMEPYTHONNODE_HXX_
3
4 #include "ServiceInlineNode.hxx"
5 #include <Python.h>
6
7 namespace YACS
8 {
9   namespace ENGINE
10   {
11     /*!
12      * This class is in charge to deal with python willing to interact with YACS placed container.
13      * Typical use is for nodes building GEOM and MESH. The great number of calls needed by this type of application,
14      * implies a human impossibility to make the corresponding graph.
15     */
16     class SalomePythonNode : public ServiceInlineNode 
17     {
18     protected:
19       Node *simpleClone(ComposedNode *father, bool editionOnly) const;
20     public:
21       SalomePythonNode(const SalomePythonNode& other, ComposedNode *father);
22       SalomePythonNode(const std::string& name);
23       virtual void execute();
24       virtual void load();
25       std::string getKind() const;
26       ServiceNode *createNode(const std::string &name);
27       SalomePythonNode* cloneNode(const std::string& name);
28     protected:
29       PyObject* _context;
30       PyObject* _pyfunc;
31     public:
32       static const char PLACEMENT_VAR_NAME_IN_INTERP[];
33     };
34   }
35 }
36
37 #endif