Salome HOME
copy tag mergefrom_BR_V0_1_CC_Salome_04oct07
[modules/yacs.git] / src / runtime / XMLPorts.hxx
1
2 #ifndef _XMLPORTS_HXX_
3 #define _XMLPORTS_HXX_
4
5 #include "InputPort.hxx"
6 #include "OutputPort.hxx"
7
8 namespace YACS
9 {
10   namespace ENGINE
11   {
12 /*! \brief Class for XML Input Ports
13  *
14  * \ingroup Ports
15  *
16  * \see XmlNode
17  */
18     class InputXmlPort : public InputPort
19     {
20     public:
21       InputXmlPort(const std::string& name, Node* node, TypeCode * type);
22       InputXmlPort(const InputXmlPort& other, Node *newHelder);
23       bool edIsManuallyInitialized() const;
24       void edRemoveManInit();
25       virtual void put(const void *data) throw (ConversionException);
26       void put(const char *data) throw (ConversionException);
27       InputPort *clone(Node *newHelder) const;
28       virtual const char * getXml() const;
29       void *get() const throw(Exception);
30       bool isEmpty();
31       virtual void exSaveInit();
32       virtual void exRestoreInit();
33       virtual std::string dump();
34     protected:
35       std::string _data;
36       std::string _initData;
37     };
38     
39 /*! \brief Class for XML Output Ports
40  *
41  * \ingroup Ports
42  *
43  * \see XmlNode
44  */
45     class OutputXmlPort : public OutputPort
46     {
47     public:
48       OutputXmlPort(const std::string& name,  Node* node, TypeCode * type);
49       OutputXmlPort(const OutputXmlPort& other, Node *newHelder);
50       virtual void put(const void *data) throw (ConversionException);
51       void put(const char *data) throw (ConversionException);
52       virtual const char * get() const throw (ConversionException);
53       OutputPort *clone(Node *newHelder) const;
54       virtual std::string dump();
55     protected:
56       std::string _data;
57     };
58
59   }
60 }
61
62 #endif