Salome HOME
merge from branch DEV tag mergeto_trunk_04apr08
[modules/yacs.git] / src / yacsloader / containerParsers.hxx
1
2 #ifndef _CONTAINERPARSER_HXX_
3 #define _CONTAINERPARSER_HXX_
4
5 #include "parserBase.hxx"
6 #include "factory.hxx"
7
8 namespace YACS
9 {
10
11 /*! \brief Class for machine parser.
12  *
13  *  Class used to parse computer adress on which container must be started
14  *
15  *  XML schema is 
16    \verbatim
17      <xsd:complexType name="MachineType">
18        <xsd:attribute name="name" type="xsd:string" use="required"/>
19      </xsd:complexType>
20    \endverbatim
21  */
22 struct machinetypeParser: parser
23 {
24   static machinetypeParser machineParser;
25   virtual void buildAttr(const XML_Char** attr);
26   virtual void pre ();
27   virtual void name(const std::string& name);
28   machine post();
29   machine _mach;
30 };
31
32 /*! \brief Class for container parser
33  *
34  *  Class used to parse container description
35  *
36  *  XML schema is 
37    \verbatim
38      <xsd:complexType name="ContainerType">
39        <xsd:sequence>
40          <xsd:element name="machine" type="MachineType" minOccurs="0" maxOccurs="unbounded"/>
41          <xsd:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
42        </xsd:sequence>
43        <xsd:attribute name="name" type="xsd:string" use="required"/>
44      </xsd:complexType>
45    \endverbatim
46  */
47 struct containertypeParser: parser
48 {
49   static containertypeParser containerParser;
50   virtual void buildAttr(const XML_Char** attr);
51   virtual void onStart(const XML_Char* el, const XML_Char** attr);
52   virtual void onEnd(const char *el,parser* child);
53   virtual void pre ();
54   virtual void name(const std::string& name);
55   virtual void machine_(const machine& m);
56   virtual void property (const myprop& prop);
57   mycontainer post();
58   mycontainer _container;
59 };
60
61 /*! \brief Class for loading parser
62  *
63  *  Class used to parse service node loading information
64  *
65  *  XML schema is 
66    \verbatim
67      <xsd:complexType name="LoadType">
68        <xsd:attribute name="container" type="xsd:string" use="required"/>
69      </xsd:complexType>
70    \endverbatim
71  */
72 struct loadtypeParser: parser
73 {
74   static loadtypeParser loadParser;
75   virtual void buildAttr(const XML_Char** attr);
76   virtual void pre ();
77   virtual void container(const std::string& name);
78   loadon post();
79   loadon _loadon;
80 };
81
82 }
83
84 #endif