]> SALOME platform Git repositories - modules/yacs.git/blob - src/runtime/XMLPorts.cxx
Salome HOME
PR: merge from BR_DATACONV_PR tag "mergeto_trunk_25oct06"
[modules/yacs.git] / src / runtime / XMLPorts.cxx
1
2 #include "XMLPorts.hxx"
3
4 #include <iostream>
5
6 using namespace YACS::ENGINE;
7 using namespace std;
8
9 InputXmlPort::InputXmlPort(const string& name, Node * node, TypeCode * type)
10   : InputPort(name, node, type), Port(node)
11 {
12   _impl="XML";
13 }
14
15 const char * InputXmlPort::getXml() const
16 {
17   return _data.c_str();
18 }
19
20 void InputXmlPort::put(const void *data) throw (ConversionException)
21 {
22   put((const char*)data);
23   _empty = false;
24 }
25
26 void InputXmlPort::put(const char *data) throw (ConversionException)
27 {
28   cerr << "InputXmlPort::put" << endl;
29   _data = data;
30   cerr << "data: " << data << endl;
31 }
32
33
34
35 OutputXmlPort::OutputXmlPort(const string& name, Node* node, TypeCode * type)
36   : OutputPort(name, node, type), Port(node)
37 {
38   _impl="XML";
39 }
40
41 const char * OutputXmlPort::get() const throw (ConversionException)
42 {
43   return _data.c_str();
44 }
45
46 void OutputXmlPort::put(const void *data) throw (ConversionException)
47 {
48   put((const char*)data);
49 }
50
51 void OutputXmlPort::put(const char *data)  throw (ConversionException)
52 {
53   cerr << "OutputXmlPort::put-------" << getName() << endl;
54   InputPort *p;
55   cerr << "data: " << data << endl;
56   _data=data;
57   set<InputPort *>::iterator iter;
58   for(iter=_setOfInputPort.begin();iter!=_setOfInputPort.end();iter++)
59     {
60       p=*iter;
61       p->put((void*)data);
62     }
63 }