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