Salome HOME
7d2a457c078f84e005ed77325d1c57d99e77c11a
[modules/yacs.git] / src / runtime / NeutralPythonConv.hxx
1 //  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef __NEUTRALPYTHONCONV_HXX__
20 #define __NEUTRALPYTHONCONV_HXX__
21
22 #include "PythonPorts.hxx"
23
24 namespace YACS
25 {
26   namespace ENGINE
27   {
28     // --- adaptator ports Neutral->Python for several types
29
30     class NeutralPyDouble : public ProxyPort
31     {
32     public:
33       NeutralPyDouble(InputPyPort* p)
34         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
35       virtual void put(const void *data) throw(ConversionException);
36       void put(YACS::ENGINE::Any *data) throw(ConversionException);
37     };
38
39     class NeutralPyInt : public ProxyPort
40     {
41     public:
42       NeutralPyInt(InputPyPort* p)
43         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
44       virtual void put(const void *data) throw(ConversionException);
45       void put(YACS::ENGINE::Any *data) throw(ConversionException);
46     };
47
48     class NeutralPyString : public ProxyPort
49     {
50     public:
51       NeutralPyString(InputPyPort* p)
52         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
53       virtual void put(const void *data) throw(ConversionException);
54       void put(YACS::ENGINE::Any *data) throw(ConversionException);
55     };
56
57     class NeutralPyBool : public ProxyPort
58     {
59     public:
60       NeutralPyBool(InputPyPort* p)
61         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
62       virtual void put(const void *data) throw(ConversionException);
63       void put(YACS::ENGINE::Any *data) throw(ConversionException);
64     };
65
66     class NeutralPyObjref : public ProxyPort
67     {
68     public:
69       NeutralPyObjref(InputPyPort* p)
70         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
71       virtual void put(const void *data) throw(ConversionException);
72       void put(YACS::ENGINE::Any *data) throw(ConversionException);
73     };
74
75     class NeutralPySequence : public ProxyPort
76     {
77     public:
78       NeutralPySequence(InputPyPort* p)
79         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
80       virtual void put(const void *data) throw(ConversionException);
81       void put(YACS::ENGINE::Any *data) throw(ConversionException);
82     };
83   }
84 }
85 #endif