Salome HOME
3a0cd4f296d5ef63e56d0f35910f78e13e93ffd3
[modules/yacs.git] / src / runtime / NeutralCORBAConv.cxx
1 // Copyright (C) 2006-2023  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 "NeutralCORBAConv.hxx"
23
24 #include <iostream>
25
26 using namespace YACS::ENGINE;
27 using namespace std;
28
29
30 void NeutralCorbaInt::put(const void *data)
31 {
32   put((YACS::ENGINE::Any *)data);
33 }
34
35 //!Convert a YACS::ENGINE::Any (integer) to CORBA::Any (integer)
36 /*!
37  *   \param data : YACS::ENGINE::Any object
38  */
39
40 void NeutralCorbaInt::put(YACS::ENGINE::Any *data)
41 {
42   CORBA::Any *a =convertNeutralCorba(edGetType(),data);
43   _port->put(a);
44   //delete Any that has been allocated by convertNeutralCorba
45   delete a;
46 }
47
48 void NeutralCorbaBool::put(const void *data)
49 {
50   put((YACS::ENGINE::Any *)data);
51 }
52
53 //!Convert a YACS::ENGINE::Any (boolean) to CORBA::Any (boolean)
54 /*!
55  *   \param data : YACS::ENGINE::Any object
56  */
57
58 void NeutralCorbaBool::put(YACS::ENGINE::Any *data)
59 {
60   CORBA::Any *a =convertNeutralCorba(edGetType(),data);
61   _port->put(a);
62   //delete Any that has been allocated by convertNeutralCorba
63   delete a;
64 }
65
66
67 void NeutralCorbaDouble::put(const void *data)
68 {
69   put((YACS::ENGINE::Any *)data);
70 }
71
72 //!Convert a YACS::ENGINE::Any (double) to CORBA::Any (double)
73 /*!
74  *   \param data : YACS::ENGINE::Any object
75  */
76
77 void NeutralCorbaDouble::put(YACS::ENGINE::Any *data)
78 {
79   CORBA::Any *a =convertNeutralCorba(edGetType(),data);
80   _port->put(a);
81   //delete Any that has been allocated by convertNeutralCorba
82   delete a;
83 }
84
85 void NeutralCorbaSequence::put(const void *data)
86 {
87   put((YACS::ENGINE::Any *)data);
88 }
89
90 //!Convert a Neutral::Any sequence to CORBA::Any* Sequence
91 /*!
92  *   \param data : Neutral::Any object
93  */
94 void NeutralCorbaSequence::put(YACS::ENGINE::Any *data)
95 {
96   CORBA::Any *a =convertNeutralCorba(edGetType(),data);
97   _port->put(a);
98   //delete Any that has been allocated by convertNeutralCorba
99   delete a;
100 }
101
102 NeutralCorbaString::NeutralCorbaString(InputCorbaPort* p):ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
103 {
104 }
105
106 void NeutralCorbaString::put(const void *data)
107 {
108   put((YACS::ENGINE::Any *)data);
109 }
110
111 //!Convert a Neutral::Any string to CORBA::Any* string
112 /*!
113  *   \param data : Neutral::Any object
114  */
115 void NeutralCorbaString::put(YACS::ENGINE::Any *data)
116 {
117   CORBA::Any *a =convertNeutralCorba(edGetType(),data);
118   _port->put(a);
119   //delete Any that has been allocated by convertNeutralCorba
120   delete a;
121 }
122
123 NeutralCorbaObjref::NeutralCorbaObjref(InputCorbaPort* p):ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
124 {
125 }
126
127 void NeutralCorbaObjref::put(const void *data)
128 {
129   put((YACS::ENGINE::Any *)data);
130 }
131
132 //!Convert a Neutral::Any Objref to CORBA::Any* Objref
133 /*!
134  *   \param data : Neutral::Any object
135  */
136 void NeutralCorbaObjref::put(YACS::ENGINE::Any *data)
137 {
138   CORBA::Any *a =convertNeutralCorba(edGetType(),data);
139   _port->put(a);
140   //delete Any that has been allocated by convertNeutralCorba
141   delete a;
142 }
143
144
145 NeutralCorbaStruct::NeutralCorbaStruct(InputCorbaPort* p)
146   : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
147 {
148 }
149
150 void NeutralCorbaStruct::put(const void *data)
151 {
152   put((YACS::ENGINE::Any *)data);
153 }
154
155 //!Convert a Neutral::Any struct to CORBA::Any* struct
156 /*!
157  *   \param data : Neutral::Any object
158  */
159 void NeutralCorbaStruct::put(YACS::ENGINE::Any *data)
160 {
161   CORBA::Any *a =convertNeutralCorba(edGetType(),data);
162   _port->put(a);
163   //delete Any that has been allocated by convertNeutralCorba
164   delete a;
165 }