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