]> SALOME platform Git repositories - modules/yacs.git/blob - src/runtime/TypeConversions.hxx
Salome HOME
merge from branch DEV tag mergeto_trunk_04apr08
[modules/yacs.git] / src / runtime / TypeConversions.hxx
1
2 #ifndef _TYPECONVERSIONS_HXX_
3 #define _TYPECONVERSIONS_HXX_
4
5 #include <Python.h>
6 #include <omniORB4/CORBA.h>
7 #include <libxml/parser.h>
8 #include <string>
9
10 namespace YACS
11 {
12   namespace ENGINE
13   {
14
15     typedef enum
16       {
17         CORBAImpl    = 1,
18         PYTHONImpl   = 2,
19         NEUTRALImpl  = 3,
20         XMLImpl      = 4,
21         CPPImpl      = 5,
22       } ImplType;
23
24     class TypeCode;
25     class Any;
26
27     CORBA::TypeCode_ptr getCorbaTC(const TypeCode *t);
28
29     int isAdaptableCorbaPyObject(const TypeCode * t1, const TypeCode * t2);
30     int isAdaptableCorbaNeutral(const TypeCode * t1, const TypeCode * t2);
31     int isAdaptableCorbaCorba(const TypeCode * t1, const TypeCode * t2);
32
33     int isAdaptableNeutralCorba(const TypeCode * t1, const TypeCode * t2);
34     int isAdaptableNeutralNeutral(const TypeCode * t1, const TypeCode * t2);
35     int isAdaptableNeutralXml(const TypeCode * t1, const TypeCode * t2);
36     int isAdaptableNeutralPyObject(const TypeCode * t1, const TypeCode * t2);
37
38     int isAdaptablePyObjectPyObject(const TypeCode * t1, const TypeCode * t2);
39     int isAdaptablePyObjectCorba(const TypeCode * t1, const TypeCode * t2);
40     int isAdaptablePyObjectNeutral(const TypeCode * t1, const TypeCode * t2);
41
42     int isAdaptableXmlNeutral(const TypeCode *t1,const TypeCode *t2);
43     int isAdaptableXmlCorba(const TypeCode *t1, const TypeCode *t2);
44
45     PyObject *convertCorbaPyObject(const TypeCode * t,CORBA::Any* ob);
46     CORBA::Any *convertCorbaCorba(const TypeCode * t,CORBA::Any* ob);
47     YACS::ENGINE::Any *convertCorbaNeutral(const TypeCode *t,CORBA::Any* ob);
48     std::string convertCorbaXml(const TypeCode * t,CORBA::Any* ob);
49
50     CORBA::Any *convertPyObjectCorba(const TypeCode *t,PyObject *ob);
51     std::string convertPyObjectXml(const TypeCode * t,PyObject* ob);
52     YACS::ENGINE::Any *convertPyObjectNeutral(const TypeCode *t,PyObject* ob);
53
54     PyObject *convertXmlPyObject(const TypeCode * t,xmlDocPtr doc,xmlNodePtr cur );
55     CORBA::Any *convertXmlCorba(const TypeCode * t,xmlDocPtr doc,xmlNodePtr cur );
56     YACS::ENGINE::Any *convertXmlNeutral(const TypeCode * t,xmlDocPtr doc,xmlNodePtr cur );
57
58     PyObject *convertNeutralPyObject(const TypeCode * t,YACS::ENGINE::Any* ob);
59     std::string convertNeutralXml(const TypeCode * t,YACS::ENGINE::Any* ob);
60     CORBA::Any *convertNeutralCorba(const TypeCode *t,YACS::ENGINE::Any *ob);
61     YACS::ENGINE::Any *convertNeutralNeutral(const TypeCode *t, YACS::ENGINE::Any* ob);
62   }
63
64 }
65
66 #endif