Salome HOME
copy tag mergefrom_BR_V0_1_CC_Salome_04oct07
[modules/yacs.git] / src / runtime / PythonXMLConv.cxx
1 #include "TypeConversions.hxx"
2 #include "PythonXMLConv.hxx"
3 #include "Node.hxx"
4
5 #include <iostream>
6
7 //#define _DEVDEBUG_
8 #include "YacsTrace.hxx"
9
10 using namespace YACS::ENGINE;
11 using namespace std;
12
13 PyXml::PyXml(InputXmlPort* p)
14   : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
15 {
16 }
17
18 //!Convert a PyObject that is convertible to Xml::char * and send it to proxy port
19 /*!
20  *   \param data : PyObject object as a void * pointer
21  */
22
23 void PyXml::put(const void *data) throw(ConversionException)
24 {
25   put((PyObject *)data);
26 }
27
28 //!Convert a PyObject that is convertible to Xml::char * and send it to proxy port
29 /*!
30  *   \param data : PyObject object
31  */
32 void PyXml::put(PyObject *data) throw(ConversionException)
33 {
34   DEBTRACE("PyXml::put" );
35   std::string sss = convertPyObjectXml(edGetType(),data);
36   ((InputXmlPort*)_port)->put((const char*)sss.c_str());
37 }