Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / src / yacsloader / factory.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 _FACTORY_HXX_
20 #define _FACTORY_HXX_
21
22 #include <string>
23 #include <vector>
24 #include <map>
25
26 struct mytype{
27     std::string _name;
28     std::string _kind;
29 };
30
31 struct mycontrol{
32     void fromnode(const std::string& fromnode) { _fromnode = fromnode; }
33     void tonode(const std::string& tonode) { _tonode = tonode; }
34     std::string fromnode()const { return _fromnode ; }
35     std::string tonode()const { return _tonode ; }
36     std::map<std::string,std::string> _props;
37     void clear()
38     {
39       _props.clear();
40     }
41     void setProperty(const std::string& name, const std::string& value)
42     {
43       _props[name]=value;
44     }
45 private:
46     std::string _fromnode;
47     std::string _tonode;
48 };
49
50 struct mylink:mycontrol{
51     void fromport(const std::string& fromport) { _fromport = fromport; }
52     void toport(const std::string& toport) { _toport = toport; }
53     std::string fromport()const { return _fromport ; }
54     std::string toport()const { return _toport ; }
55     bool withControl() const { return _withControl ;}
56
57     bool _withControl;
58 private:
59     std::string _fromport;
60     std::string _toport;
61 public:
62     void clear()
63     {
64       _props.clear();
65       _withControl=true;
66     }
67 };
68
69 struct mystream:mylink{
70 };
71
72 struct myparam{
73     std::string _tonode;
74     std::string _toport;
75     std::string _value;
76 };
77
78 struct myinport{
79     std::string _name;
80     std::string _type;
81     std::map<std::string,std::string> _props;
82     void clear()
83     {
84       _props.clear();
85     }
86     void setProperty(const std::string& name, const std::string& value)
87     {
88       _props[name]=value;
89     }
90 };
91
92 struct myoutport:myinport{};
93
94 struct myprop{
95     std::string _name;
96     std::string _value;
97 };
98
99 typedef std::vector<myprop> myprops;
100
101 struct myfunc{
102     std::string _name;
103     std::string _code;
104 };
105
106 struct machine
107 {
108     std::string _name;
109 };
110 typedef std::vector<machine> machines;
111
112 struct mycontainer
113 {
114   std::string _name;
115   machines _machs;
116   std::map<std::string,std::string> _props;
117 };
118
119 struct loadon
120 {
121     std::string _container;
122 };
123
124 #endif