]> SALOME platform Git repositories - modules/yacs.git/blob - src/yacsloader/containerParsers.hxx
Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / src / yacsloader / containerParsers.hxx
1 //  Copyright (C) 2006-2008  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.
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 #ifndef _CONTAINERPARSER_HXX_
20 #define _CONTAINERPARSER_HXX_
21
22 #include "parserBase.hxx"
23 #include "factory.hxx"
24
25 namespace YACS
26 {
27
28 /*! \brief Class for machine parser.
29  *
30  *  Class used to parse computer adress on which container must be started
31  *
32  *  XML schema is 
33    \verbatim
34      <xsd:complexType name="MachineType">
35        <xsd:attribute name="name" type="xsd:string" use="required"/>
36      </xsd:complexType>
37    \endverbatim
38  */
39 struct machinetypeParser: parser
40 {
41   static machinetypeParser machineParser;
42   virtual void buildAttr(const XML_Char** attr);
43   virtual void pre ();
44   virtual void name(const std::string& name);
45   machine post();
46   machine _mach;
47 };
48
49 /*! \brief Class for container parser
50  *
51  *  Class used to parse container description
52  *
53  *  XML schema is 
54    \verbatim
55      <xsd:complexType name="ContainerType">
56        <xsd:sequence>
57          <xsd:element name="machine" type="MachineType" minOccurs="0" maxOccurs="unbounded"/>
58          <xsd:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
59        </xsd:sequence>
60        <xsd:attribute name="name" type="xsd:string" use="required"/>
61      </xsd:complexType>
62    \endverbatim
63  */
64 struct containertypeParser: parser
65 {
66   static containertypeParser containerParser;
67   virtual void buildAttr(const XML_Char** attr);
68   virtual void onStart(const XML_Char* el, const XML_Char** attr);
69   virtual void onEnd(const char *el,parser* child);
70   virtual void pre ();
71   virtual void name(const std::string& name);
72   virtual void machine_(const machine& m);
73   virtual void property (const myprop& prop);
74   mycontainer post();
75   mycontainer _container;
76 };
77
78 /*! \brief Class for loading parser
79  *
80  *  Class used to parse service node loading information
81  *
82  *  XML schema is 
83    \verbatim
84      <xsd:complexType name="LoadType">
85        <xsd:attribute name="container" type="xsd:string" use="required"/>
86      </xsd:complexType>
87    \endverbatim
88  */
89 struct loadtypeParser: parser
90 {
91   static loadtypeParser loadParser;
92   virtual void buildAttr(const XML_Char** attr);
93   virtual void pre ();
94   virtual void container(const std::string& name);
95   loadon post();
96   loadon _loadon;
97 };
98
99 }
100
101 #endif