Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / src / runtime / CORBAPythonConv.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 __CORBAPYTHONCONV_HXX__
20 #define __CORBAPYTHONCONV_HXX__
21
22 #include <omniORB4/CORBA.h>
23 #include "InputPort.hxx"
24 #include "ConversionException.hxx"
25
26 namespace YACS
27 {
28   namespace ENGINE
29   {
30     class InputPyPort;
31
32 /*! \brief Class for conversion from CORBA Output port to Python Input port
33  *
34  * \ingroup AdaptorPorts
35  *
36  */
37     class CorbaPyDouble : public ProxyPort
38     {
39     public:
40       CorbaPyDouble(InputPyPort* p);
41       virtual void put(const void *data) throw(ConversionException);
42       void put(CORBA::Any *data) throw(ConversionException);
43     };
44
45 /*! \brief Class for conversion from CORBA Output port to Python Input port
46  *
47  * \ingroup AdaptorPorts
48  *
49  */
50     class CorbaPyInt : public ProxyPort
51     {
52     public:
53       CorbaPyInt(InputPyPort* p);
54       virtual void put(const void *data) throw(ConversionException);
55       void put(CORBA::Any *data) throw(ConversionException);
56     };
57
58 /*! \brief Class for conversion from CORBA Output port to Python Input port
59  *
60  * \ingroup AdaptorPorts
61  *
62  */
63     class CorbaPyString : public ProxyPort
64     {
65     public:
66       CorbaPyString(InputPyPort* p);
67       virtual void put(const void *data) throw(ConversionException);
68       void put(CORBA::Any *data) throw(ConversionException);
69     };
70
71 /*! \brief Class for conversion from CORBA Output port to Python Input port
72  *
73  * Convert boolean data
74  *
75  * \ingroup AdaptorPorts
76  *
77  */
78     class CorbaPyBool : public ProxyPort
79     {
80     public:
81       CorbaPyBool(InputPyPort* p);
82       virtual void put(const void *data) throw(ConversionException);
83       void put(CORBA::Any *data) throw(ConversionException);
84     };
85
86 /*! \brief Class for conversion from CORBA Output port to Python Input port
87  *
88  * \ingroup AdaptorPorts
89  *
90  */
91     class CorbaPyObjref : public ProxyPort
92     {
93     public:
94       CorbaPyObjref(InputPyPort* p);
95       virtual void put(const void *data) throw(ConversionException);
96       void put(CORBA::Any *data) throw(ConversionException);
97     };
98
99 /*! \brief Class for conversion from CORBA Output port to Python Input port
100  *
101  * \ingroup AdaptorPorts
102  *
103  */
104     class CorbaPySequence : public ProxyPort
105     {
106     public:
107       CorbaPySequence(InputPyPort* p);
108       virtual void put(const void *data) throw(ConversionException);
109       void put(CORBA::Any *data) throw(ConversionException);
110     protected:
111       DynamicAny::DynAnyFactory_ptr _dynfactory;
112     };
113
114 /*! \brief Class for conversion of struct objects from CORBA Output port to Python Input port
115  *
116  * \ingroup AdaptorPorts
117  *
118  */
119     class CorbaPyStruct : public ProxyPort
120     {
121     public:
122       CorbaPyStruct(InputPyPort* p);
123       virtual void put(const void *data) throw(ConversionException);
124       void put(CORBA::Any *data) throw(ConversionException);
125     };
126
127   }
128 }
129 #endif