Salome HOME
76a1d168aee9b21bfbb43c5590bfc78d0694e36e
[modules/yacs.git] / src / runtime / NeutralPythonConv.hxx
1 // Copyright (C) 2006-2023  CEA, EDF
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, or (at your option) any later version.
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
20 #ifndef __NEUTRALPYTHONCONV_HXX__
21 #define __NEUTRALPYTHONCONV_HXX__
22
23 #include "PythonPorts.hxx"
24
25 namespace YACS
26 {
27   namespace ENGINE
28   {
29     // --- adaptator ports Neutral->Python for several types
30
31     class NeutralPyDouble : public ProxyPort
32     {
33     public:
34       NeutralPyDouble(InputPyPort* p)
35         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
36       virtual void put(const void *data);
37       void put(YACS::ENGINE::Any *data);
38     };
39
40     class NeutralPyInt : public ProxyPort
41     {
42     public:
43       NeutralPyInt(InputPyPort* p)
44         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
45       virtual void put(const void *data);
46       void put(YACS::ENGINE::Any *data);
47     };
48
49     class NeutralPyString : public ProxyPort
50     {
51     public:
52       NeutralPyString(InputPyPort* p)
53         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
54       virtual void put(const void *data);
55       void put(YACS::ENGINE::Any *data);
56     };
57
58     class NeutralPyBool : public ProxyPort
59     {
60     public:
61       NeutralPyBool(InputPyPort* p)
62         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
63       virtual void put(const void *data);
64       void put(YACS::ENGINE::Any *data);
65     };
66
67     class NeutralPyObjref : public ProxyPort
68     {
69     public:
70       NeutralPyObjref(InputPyPort* p)
71         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
72       virtual void put(const void *data);
73       void put(YACS::ENGINE::Any *data);
74     };
75
76     class NeutralPySequence : public ProxyPort
77     {
78     public:
79       NeutralPySequence(InputPyPort* p)
80         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
81       virtual void put(const void *data);
82       void put(YACS::ENGINE::Any *data);
83     };
84
85     class NeutralPyStruct : public ProxyPort
86     {
87     public:
88       NeutralPyStruct(InputPyPort* p)
89         : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode()) {}
90       virtual void put(const void *data);
91       void put(YACS::ENGINE::Any *data);
92     };
93   }
94 }
95 #endif