Salome HOME
PR: merge from BR_DATACONV_PR tag "mergeto_trunk_25oct06"
[modules/yacs.git] / src / runtime / PythonPorts.hxx
1
2 #ifndef _PYTHONPORTS_HXX_
3 #define _PYTHONPORTS_HXX_
4
5 #include <Python.h>
6
7 #include "InputPort.hxx"
8 #include "OutputPort.hxx"
9
10 namespace YACS
11 {
12   namespace ENGINE
13   {
14
15     class InputPyPort : public InputPort
16     {
17     public:
18       InputPyPort(const std::string& name, Node * node, TypeCode * type);
19       virtual void put(const void *data) throw(ConversionException);
20       void put(PyObject *data) throw(ConversionException);
21       virtual PyObject * getPyObj() const;
22     protected:
23       PyObject* _data;
24     };
25
26     class OutputPyPort : public OutputPort
27     {
28     public:
29       OutputPyPort(const std::string& name, Node * node, TypeCode * type);
30       virtual void put(const void *data) throw(ConversionException);
31       void put(PyObject *data) throw(ConversionException);
32       virtual PyObject * get() const;
33     protected:
34       PyObject* _data;
35     };
36
37
38
39   }
40 }
41
42 #endif