Salome HOME
Copyright update: 2016
[modules/yacs.git] / src / runtime / XMLPorts.hxx
1 // Copyright (C) 2006-2016  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, or (at your option) any later version.
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
20 #ifndef _XMLPORTS_HXX_
21 #define _XMLPORTS_HXX_
22
23 #include "YACSRuntimeSALOMEExport.hxx"
24 #include "InputPort.hxx"
25 #include "OutputPort.hxx"
26
27 namespace YACS
28 {
29   namespace ENGINE
30   {
31 /*! \brief Class for XML Input Ports
32  *
33  * \ingroup Ports
34  *
35  * \see XmlNode
36  */
37     class YACSRUNTIMESALOME_EXPORT InputXmlPort : public InputPort
38     {
39     public:
40       InputXmlPort(const std::string& name, Node* node, TypeCode * type);
41       InputXmlPort(const InputXmlPort& other, Node *newHelder);
42       bool edIsManuallyInitialized() const;
43       void edRemoveManInit();
44       virtual void put(const void *data) throw (ConversionException);
45       void put(const char *data) throw (ConversionException);
46       InputPort *clone(Node *newHelder) const;
47       virtual const char * getXml() const;
48       void *get() const throw(Exception);
49       bool isEmpty();
50       virtual void exSaveInit();
51       virtual void exRestoreInit();
52       virtual std::string dump();
53       virtual std::string valToStr();
54       virtual void valFromStr(std::string valstr);
55     protected:
56       std::string _data;
57       std::string _initData;
58     };
59     
60 /*! \brief Class for XML Output Ports
61  *
62  * \ingroup Ports
63  *
64  * \see XmlNode
65  */
66     class YACSRUNTIMESALOME_EXPORT OutputXmlPort : public OutputPort
67     {
68     public:
69       OutputXmlPort(const std::string& name,  Node* node, TypeCode * type);
70       OutputXmlPort(const OutputXmlPort& other, Node *newHelder);
71       virtual void put(const void *data) throw (ConversionException);
72       void put(const char *data) throw (ConversionException);
73       virtual const char * get() const throw (ConversionException);
74       OutputPort *clone(Node *newHelder) const;
75       virtual std::string dump();
76       virtual std::string valToStr();
77       virtual void valFromStr(std::string valstr);
78     protected:
79       std::string _data;
80     };
81
82   }
83 }
84
85 #endif