Version: 8.3.0
CORBAPythonConv.cxx
Go to the documentation of this file.
1 // Copyright (C) 2006-2016 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, 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 #include "TypeConversions.hxx"
21 #include "RuntimeSALOME.hxx"
22 #include "CORBAPythonConv.hxx"
23 #include "PythonPorts.hxx"
24 
25 #include <iostream>
26 
27 //#define _DEVDEBUG_
28 #include "YacsTrace.hxx"
29 
30 using namespace YACS::ENGINE;
31 using namespace std;
32 
34  : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
35 {}
36 
37 void CorbaPyDouble::put(const void *data) throw(ConversionException)
38 {
39  put((CORBA::Any *)data);
40 }
41 
43 
46 void CorbaPyDouble::put(CORBA::Any *data) throw(ConversionException)
47 {
49  PyObject* ob=convertCorbaPyObject(edGetType(),data);
50  DEBTRACE("ob refcnt: " << ob->ob_refcnt );
51  _port->put(ob);
52  Py_DECREF(ob);
53 }
54 
55 
57  : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
58 {}
59 
60 void CorbaPyInt::put(const void *data) throw(ConversionException)
61 {
62  put((CORBA::Any *)data);
63 }
64 
66 
69 void CorbaPyInt::put(CORBA::Any *data) throw(ConversionException)
70 {
72  PyObject* ob=convertCorbaPyObject(edGetType(),data);
73  DEBTRACE("ob refcnt: " << ob->ob_refcnt );
74  _port->put(ob);
75  Py_DECREF(ob);
76 }
77 
79  : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
80 {}
81 void CorbaPyString::put(const void *data) throw(ConversionException)
82 {
83  put((CORBA::Any *)data);
84 }
85 
87 
90 void CorbaPyString::put(CORBA::Any *data) throw(ConversionException)
91 {
93  PyObject* ob=convertCorbaPyObject(edGetType(),data);
94  DEBTRACE("ob refcnt: " << ob->ob_refcnt );
95  _port->put(ob);
96  Py_DECREF(ob);
97 }
98 
100  : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
101 {}
102 
106 void CorbaPyBool::put(const void *data) throw(ConversionException)
107 {
108  put((CORBA::Any *)data);
109 }
110 
112 
115 void CorbaPyBool::put(CORBA::Any *data) throw(ConversionException)
116 {
118  PyObject* ob=convertCorbaPyObject(edGetType(),data);
119  DEBTRACE("ob refcnt: " << ob->ob_refcnt );
120  _port->put(ob);
121  Py_DECREF(ob);
122 }
123 
125  : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
126 {}
127 
128 void CorbaPyObjref::put(const void *data) throw(ConversionException)
129 {
130  put((CORBA::Any *)data);
131 }
132 
134 
137 void CorbaPyObjref::put(CORBA::Any *data) throw(ConversionException)
138 {
140  PyObject* ob=convertCorbaPyObject(edGetType(),data);
141  DEBTRACE("ob refcnt: " << ob->ob_refcnt );
142  _port->put(ob);
143  Py_DECREF(ob);
144 }
145 
147 
151  : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
152 {
154 }
155 
156 void CorbaPySequence::put(const void *data) throw(ConversionException)
157 {
158  put((CORBA::Any *)data);
159 }
160 
162 
165 void CorbaPySequence::put(CORBA::Any *data) throw(ConversionException)
166 {
168  PyObject* ob=convertCorbaPyObject(edGetType(),data);
169  DEBTRACE("ob refcnt: " << ob->ob_refcnt );
170  _port->put(ob);
171  Py_DECREF(ob);
172 }
173 
175 
179  : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
180 {
181 }
182 
183 void CorbaPyStruct::put(const void *data) throw(ConversionException)
184 {
185  put((CORBA::Any *)data);
186 }
187 
189 
192 void CorbaPyStruct::put(CORBA::Any *data) throw(ConversionException)
193 {
195  PyObject* ob=convertCorbaPyObject(edGetType(),data);
196  DEBTRACE("ob refcnt: " << ob->ob_refcnt );
197  _port->put(ob);
198  Py_DECREF(ob);
199 }