83 | | <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define UIREGISTER(class_name) template<> const Particular_UI<class_name>& Particular_UI<class_name>::ui = Particular_UI<class_name>(#class_name) </span> |
84 | | <a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#else</span> |
85 | | <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define UIREGISTER(class_name)</span> |
86 | | <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
87 | | <a name="l00023"></a>00023 <span class="preprocessor"></span> |
88 | | <a name="l00024"></a>00024 <span class="preprocessor">#define ASSERT_UITYPE(S,Type) it_assert_debug(S.getType()==Setting::Type, string("Wrong setting type, see input path \"")+string(S.getPath())+string("\""))</span> |
89 | | <a name="l00025"></a>00025 <span class="preprocessor"></span> |
90 | | <a name="l00026"></a>00026 <span class="keyword">namespace </span>bdm |
91 | | <a name="l00027"></a>00027 { |
92 | | <a name="l00028"></a>00028 <span class="keyword">class </span>UI_File : <span class="keyword">public</span> Config |
93 | | <a name="l00029"></a>00029 { |
94 | | <a name="l00030"></a>00030 <span class="keyword">private</span>: |
95 | | <a name="l00031"></a>00031 <span class="keyword">const</span> <span class="keywordtype">string</span> file_name; |
96 | | <a name="l00032"></a>00032 |
97 | | <a name="l00033"></a>00033 <span class="keyword">public</span>: |
98 | | <a name="l00035"></a>00035 UI_File(); |
99 | | <a name="l00036"></a>00036 |
100 | | <a name="l00038"></a>00038 UI_File( <span class="keyword">const</span> <span class="keywordtype">string</span> &file_name ); |
101 | | <a name="l00039"></a>00039 |
102 | | <a name="l00041"></a>00041 <span class="keywordtype">void</span> save(<span class="keyword">const</span> <span class="keywordtype">string</span> &file_name); |
103 | | <a name="l00042"></a>00042 |
104 | | <a name="l00043"></a>00043 operator Setting&(); |
105 | | <a name="l00044"></a>00044 }; |
106 | | <a name="l00045"></a>00045 |
107 | | <a name="l00077"></a><a class="code" href="classbdm_1_1UI.html">00077</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1UI.html" title="This class serves to load and/or save DOMElements into/from files stored on a hard-disk...">UI</a> |
108 | | <a name="l00078"></a>00078 { |
109 | | <a name="l00079"></a>00079 <span class="keyword">private</span>: |
110 | | <a name="l00084"></a>00084 <span class="keyword">class </span>Mapped_UI |
111 | | <a name="l00085"></a>00085 { |
112 | | <a name="l00086"></a>00086 <span class="keyword">private</span>: |
113 | | <a name="l00088"></a>00088 <span class="keyword">typedef</span> map< const string, const UI* const > String_To_UI_Map; |
114 | | <a name="l00089"></a>00089 |
115 | | <a name="l00091"></a>00091 <span class="keyword">typedef</span> map< const type_info * const, const string > Type_Info_To_String_Map; |
116 | | <a name="l00092"></a>00092 |
117 | | <a name="l00094"></a>00094 <span class="keyword">static</span> String_To_UI_Map& mapped_strings(); |
118 | | <a name="l00095"></a>00095 |
119 | | <a name="l00097"></a>00097 <span class="keyword">static</span> Type_Info_To_String_Map& mapped_type_infos(); |
120 | | <a name="l00098"></a>00098 |
121 | | <a name="l00099"></a>00099 <span class="keyword">public</span>: |
122 | | <a name="l00101"></a>00101 <span class="keyword">static</span> <span class="keywordtype">void</span> add_class( <span class="keyword">const</span> <span class="keywordtype">string</span> &class_name, <span class="keyword">const</span> type_info * <span class="keyword">const</span> class_type_info, <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI.html" title="This class serves to load and/or save DOMElements into/from files stored on a hard-disk...">UI</a>* <span class="keyword">const</span> ui ); |
123 | | <a name="l00102"></a>00102 |
124 | | <a name="l00104"></a>00104 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI.html" title="This class serves to load and/or save DOMElements into/from files stored on a hard-disk...">UI</a>& retrieve_ui( <span class="keyword">const</span> <span class="keywordtype">string</span> &class_name ); |
125 | | <a name="l00105"></a>00105 |
126 | | <a name="l00107"></a>00107 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">string</span>& retrieve_class_name( <span class="keyword">const</span> type_info* <span class="keyword">const</span> class_type_info ); |
127 | | <a name="l00108"></a>00108 }; |
128 | | <a name="l00109"></a>00109 |
| 83 | <a name="l00020"></a>00020 <span class="preprocessor">#define UIREGISTER(class_name) template<> const Particular_UI<class_name>& Particular_UI<class_name>::ui = Particular_UI<class_name>(#class_name) </span> |
| 84 | <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#else</span> |
| 85 | <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define UIREGISTER(class_name)</span> |
| 86 | <a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 87 | <a name="l00024"></a>00024 <span class="preprocessor"></span> |
| 88 | <a name="l00025"></a>00025 <span class="preprocessor">#define ASSERT_UITYPE(S,Type) it_assert_debug(S.getType()==Setting::Type, string("Wrong setting type, see input path \"")+string(S.getPath())+string("\""))</span> |
| 89 | <a name="l00026"></a>00026 <span class="preprocessor"></span> |
| 90 | <a name="l00027"></a>00027 <span class="keyword">namespace </span>bdm |
| 91 | <a name="l00028"></a>00028 { |
| 92 | <a name="l00029"></a>00029 <span class="keyword">class </span>UI_File : <span class="keyword">public</span> Config |
| 93 | <a name="l00030"></a>00030 { |
| 94 | <a name="l00031"></a>00031 <span class="keyword">private</span>: |
| 95 | <a name="l00032"></a>00032 <span class="keyword">const</span> <span class="keywordtype">string</span> file_name; |
| 96 | <a name="l00033"></a>00033 |
| 97 | <a name="l00034"></a>00034 <span class="keyword">public</span>: |
| 98 | <a name="l00036"></a>00036 UI_File(); |
| 99 | <a name="l00037"></a>00037 |
| 100 | <a name="l00039"></a>00039 UI_File( <span class="keyword">const</span> <span class="keywordtype">string</span> &file_name ); |
| 101 | <a name="l00040"></a>00040 |
| 102 | <a name="l00042"></a>00042 <span class="keywordtype">void</span> save(<span class="keyword">const</span> <span class="keywordtype">string</span> &file_name); |
| 103 | <a name="l00043"></a>00043 |
| 104 | <a name="l00044"></a>00044 operator Setting&(); |
| 105 | <a name="l00045"></a>00045 }; |
| 106 | <a name="l00046"></a>00046 |
| 107 | <a name="l00078"></a><a class="code" href="classbdm_1_1UI.html">00078</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1UI.html" title="This class serves to load and/or save DOMElements into/from files stored on a hard-disk...">UI</a> |
| 108 | <a name="l00079"></a>00079 { |
| 109 | <a name="l00080"></a>00080 <span class="keyword">private</span>: |
| 110 | <a name="l00085"></a>00085 <span class="keyword">class </span>Mapped_UI |
| 111 | <a name="l00086"></a>00086 { |
| 112 | <a name="l00087"></a>00087 <span class="keyword">private</span>: |
| 113 | <a name="l00089"></a>00089 <span class="keyword">typedef</span> map< const string, const UI* const > String_To_UI_Map; |
| 114 | <a name="l00090"></a>00090 |
| 115 | <a name="l00092"></a>00092 <span class="keyword">typedef</span> map< const type_info * const, const string > Type_Info_To_String_Map; |
| 116 | <a name="l00093"></a>00093 |
| 117 | <a name="l00095"></a>00095 <span class="keyword">static</span> String_To_UI_Map& mapped_strings(); |
| 118 | <a name="l00096"></a>00096 |
| 119 | <a name="l00098"></a>00098 <span class="keyword">static</span> Type_Info_To_String_Map& mapped_type_infos(); |
| 120 | <a name="l00099"></a>00099 |
| 121 | <a name="l00100"></a>00100 <span class="keyword">public</span>: |
| 122 | <a name="l00102"></a>00102 <span class="keyword">static</span> <span class="keywordtype">void</span> add_class( <span class="keyword">const</span> <span class="keywordtype">string</span> &class_name, <span class="keyword">const</span> type_info * <span class="keyword">const</span> class_type_info, <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI.html" title="This class serves to load and/or save DOMElements into/from files stored on a hard-disk...">UI</a>* <span class="keyword">const</span> ui ); |
| 123 | <a name="l00103"></a>00103 |
| 124 | <a name="l00105"></a>00105 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI.html" title="This class serves to load and/or save DOMElements into/from files stored on a hard-disk...">UI</a>& retrieve_ui( <span class="keyword">const</span> <span class="keywordtype">string</span> &class_name ); |
| 125 | <a name="l00106"></a>00106 |
| 126 | <a name="l00108"></a>00108 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">string</span>& retrieve_class_name( <span class="keyword">const</span> type_info* <span class="keyword">const</span> class_type_info ); |
| 127 | <a name="l00109"></a>00109 }; |
139 | | <a name="l00126"></a>00126 |
140 | | <a name="l00128"></a>00128 <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( mat& matrix, <span class="keyword">const</span> Setting &element ); |
141 | | <a name="l00130"></a>00130 <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( ivec &vector, <span class="keyword">const</span> Setting &element ); |
142 | | <a name="l00131"></a>00131 <span class="comment">// jednak kvuli pretypovani, apak taky proto, ze na string nefunguje link_expander..</span> |
143 | | <a name="l00132"></a>00132 <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( <span class="keywordtype">string</span> &<a class="code" href="classbdm_1_1str.html" title="Structure of RV (used internally), i.e. expanded RVs - TODO tak proc je ve verejnem...">str</a>, <span class="keyword">const</span> Setting &element ); |
144 | | <a name="l00134"></a>00134 |
145 | | <a name="l00135"></a>00135 <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( vec &vector, <span class="keyword">const</span> Setting &element ); |
146 | | <a name="l00136"></a>00136 |
147 | | <a name="l00137"></a>00137 <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( T* &instance, <span class="keyword">const</span> Setting &element ) |
148 | | <a name="l00138"></a>00138 { |
149 | | <a name="l00139"></a>00139 <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">SettingsResolver</a> link_expander( element ); |
150 | | <a name="l00140"></a>00140 <span class="keyword">const</span> Setting &root = link_expander.<a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html#5b09858b705318e7f23c3077fc62c199">root</a>(); |
151 | | <a name="l00141"></a>00141 |
152 | | <a name="l00142"></a>00142 ASSERT_UITYPE(root,TypeGroup); |
153 | | <a name="l00143"></a>00143 |
154 | | <a name="l00144"></a>00144 <span class="comment">// we get a velue stored in the "class" attribute </span> |
155 | | <a name="l00145"></a>00145 <span class="keywordtype">string</span> class_name; |
156 | | <a name="l00146"></a>00146 <span class="keywordflow">if</span>( !root.lookupValue( <span class="stringliteral">"class"</span>, class_name ) ) |
157 | | <a name="l00147"></a>00147 ui_error( <span class="stringliteral">"the obligatory "</span><span class="stringliteral">"class"</span><span class="stringliteral">" identifier is missing"</span>, root ); |
158 | | <a name="l00148"></a>00148 |
159 | | <a name="l00149"></a>00149 <span class="comment">// and finally we find a UserInfo related to this type</span> |
160 | | <a name="l00150"></a>00150 <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI.html" title="This class serves to load and/or save DOMElements into/from files stored on a hard-disk...">UI</a>& related_UI = Mapped_UI::retrieve_ui( class_name ); |
161 | | <a name="l00151"></a>00151 |
162 | | <a name="l00152"></a>00152 <a class="code" href="classbdm_1_1bdmroot.html" title="Root class of BDM objects.">bdmroot</a>* typeless_instance = related_UI.<a class="code" href="classbdm_1_1UI.html#381571c026cf63837caff2f150315ea3" title="internal method assembling a typeless instance from components obtained by the &#39;AssemblyComponen...">new_instance</a>(); |
163 | | <a name="l00153"></a>00153 |
164 | | <a name="l00154"></a>00154 instance = NULL; |
165 | | <a name="l00155"></a>00155 <span class="keywordflow">try</span> |
166 | | <a name="l00156"></a>00156 { |
167 | | <a name="l00157"></a>00157 instance = (T*) typeless_instance ; |
168 | | <a name="l00158"></a>00158 } |
169 | | <a name="l00159"></a>00159 <span class="keywordflow">catch</span>(...) |
170 | | <a name="l00160"></a>00160 { |
171 | | <a name="l00161"></a>00161 it_error ( <span class="stringliteral">"UI error: class "</span> + class_name + <span class="stringliteral">" is not a descendant of the desired output class. Try to call the UI::build function with a different type parameter."</span> ); |
172 | | <a name="l00162"></a>00162 } |
173 | | <a name="l00163"></a>00163 |
174 | | <a name="l00164"></a>00164 <span class="keywordflow">try</span> |
175 | | <a name="l00165"></a>00165 { |
176 | | <a name="l00166"></a>00166 instance->from_setting( root ); |
177 | | <a name="l00167"></a>00167 } |
178 | | <a name="l00168"></a>00168 <span class="keywordflow">catch</span>(SettingException xcptn) |
179 | | <a name="l00169"></a>00169 { |
180 | | <a name="l00170"></a>00170 it_error ( <span class="stringliteral">"UI error: the method "</span> + class_name + <span class="stringliteral">".from_setting(Setting&) has thrown an exception when parsing the setting "</span> + xcptn.getPath() + <span class="stringliteral">". Try to correct this method."</span> ); |
181 | | <a name="l00171"></a>00171 } |
182 | | <a name="l00172"></a>00172 } |
183 | | <a name="l00173"></a>00173 |
| 138 | <a name="l00124"></a>00124 |
| 139 | <a name="l00127"></a>00127 |
| 140 | <a name="l00129"></a>00129 <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( mat& matrix, <span class="keyword">const</span> Setting &element ); |
| 141 | <a name="l00131"></a>00131 <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( ivec &vector, <span class="keyword">const</span> Setting &element ); |
| 142 | <a name="l00132"></a>00132 <span class="comment">// jednak kvuli pretypovani, apak taky proto, ze na string nefunguje link_expander..</span> |
| 143 | <a name="l00133"></a>00133 <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( <span class="keywordtype">string</span> &<a class="code" href="classbdm_1_1str.html" title="Structure of RV (used internally), i.e. expanded RVs - TODO tak proc je ve verejnem...">str</a>, <span class="keyword">const</span> Setting &element ); |
| 144 | <a name="l00135"></a>00135 |
| 145 | <a name="l00136"></a>00136 <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( vec &vector, <span class="keyword">const</span> Setting &element ); |
| 146 | <a name="l00137"></a>00137 |
| 147 | <a name="l00138"></a>00138 <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( T* &instance, <span class="keyword">const</span> Setting &element ) |
| 148 | <a name="l00139"></a>00139 { |
| 149 | <a name="l00140"></a>00140 <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">SettingsResolver</a> link_expander( element ); |
| 150 | <a name="l00141"></a>00141 <span class="keyword">const</span> Setting &root = link_expander.<a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html#5b09858b705318e7f23c3077fc62c199">root</a>(); |
| 151 | <a name="l00142"></a>00142 |
| 152 | <a name="l00143"></a>00143 ASSERT_UITYPE(root,TypeGroup); |
| 153 | <a name="l00144"></a>00144 |
| 154 | <a name="l00145"></a>00145 <span class="comment">// we get a velue stored in the "class" attribute </span> |
| 155 | <a name="l00146"></a>00146 <span class="keywordtype">string</span> class_name; |
| 156 | <a name="l00147"></a>00147 <span class="keywordflow">if</span>( !root.lookupValue( <span class="stringliteral">"class"</span>, class_name ) ) |
| 157 | <a name="l00148"></a>00148 ui_error( <span class="stringliteral">"the obligatory "</span><span class="stringliteral">"class"</span><span class="stringliteral">" identifier is missing"</span>, root ); |
| 158 | <a name="l00149"></a>00149 |
| 159 | <a name="l00150"></a>00150 <span class="comment">// and finally we find a UserInfo related to this type</span> |
| 160 | <a name="l00151"></a>00151 <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI.html" title="This class serves to load and/or save DOMElements into/from files stored on a hard-disk...">UI</a>& related_UI = Mapped_UI::retrieve_ui( class_name ); |
| 161 | <a name="l00152"></a>00152 |
| 162 | <a name="l00153"></a>00153 <a class="code" href="classbdm_1_1bdmroot.html" title="Root class of BDM objects.">bdmroot</a>* typeless_instance = related_UI.<a class="code" href="classbdm_1_1UI.html#381571c026cf63837caff2f150315ea3" title="internal method assembling a typeless instance from components obtained by the &#39;AssemblyComponen...">new_instance</a>(); |
| 163 | <a name="l00154"></a>00154 |
| 164 | <a name="l00155"></a>00155 instance = NULL; |
| 165 | <a name="l00156"></a>00156 <span class="keywordflow">try</span> |
| 166 | <a name="l00157"></a>00157 { |
| 167 | <a name="l00158"></a>00158 instance = (T*) typeless_instance ; |
| 168 | <a name="l00159"></a>00159 } |
| 169 | <a name="l00160"></a>00160 <span class="keywordflow">catch</span>(...) |
| 170 | <a name="l00161"></a>00161 { |
| 171 | <a name="l00162"></a>00162 it_error ( <span class="stringliteral">"UI error: class "</span> + class_name + <span class="stringliteral">" is not a descendant of the desired output class. Try to call the UI::build function with a different type parameter."</span> ); |
| 172 | <a name="l00163"></a>00163 } |
| 173 | <a name="l00164"></a>00164 |
| 174 | <a name="l00165"></a>00165 <span class="keywordflow">try</span> |
| 175 | <a name="l00166"></a>00166 { |
| 176 | <a name="l00167"></a>00167 instance->from_setting( root ); |
| 177 | <a name="l00168"></a>00168 } |
| 178 | <a name="l00169"></a>00169 <span class="keywordflow">catch</span>(SettingException xcptn) |
| 179 | <a name="l00170"></a>00170 { |
| 180 | <a name="l00171"></a>00171 it_error ( <span class="stringliteral">"UI error: the method "</span> + class_name + <span class="stringliteral">".from_setting(Setting&) has thrown an exception when parsing the setting "</span> + xcptn.getPath() + <span class="stringliteral">". Try to correct this method."</span> ); |
| 181 | <a name="l00172"></a>00172 } |
| 182 | <a name="l00173"></a>00173 } |
185 | | <a name="l00176"></a>00176 <span class="comment">// efektivne jen pro vect, mat a string, pro dalsi je nutne pridat from_setting metodu.. ale to asi necceme</span> |
186 | | <a name="l00177"></a>00177 <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( Array<T> &array_to_load, <span class="keyword">const</span> Setting &element ) |
187 | | <a name="l00178"></a>00178 { |
188 | | <a name="l00179"></a>00179 <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">SettingsResolver</a> link_expander( element ); |
189 | | <a name="l00180"></a>00180 <span class="keyword">const</span> Setting &root = link_expander.<a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html#5b09858b705318e7f23c3077fc62c199">root</a>(); |
190 | | <a name="l00181"></a>00181 |
191 | | <a name="l00182"></a>00182 ASSERT_UITYPE(root,TypeList); |
192 | | <a name="l00183"></a>00183 |
193 | | <a name="l00184"></a>00184 <span class="keywordtype">int</span> len = root.getLength(); |
194 | | <a name="l00185"></a>00185 array_to_load.set_length( len ); |
195 | | <a name="l00186"></a>00186 <span class="keywordflow">if</span>( len == 0 ) <span class="keywordflow">return</span>; |
196 | | <a name="l00187"></a>00187 |
197 | | <a name="l00188"></a>00188 <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; i < len; i++ ) |
198 | | <a name="l00189"></a>00189 from_setting( array_to_load(i), root[i] ); |
199 | | <a name="l00190"></a>00190 } |
200 | | <a name="l00191"></a>00191 |
201 | | <a name="l00193"></a>00193 |
| 184 | <a name="l00175"></a>00175 |
| 185 | <a name="l00177"></a>00177 <span class="comment">// efektivne jen pro vect, mat a string, pro dalsi je nutne pridat from_setting metodu.. ale to asi necceme</span> |
| 186 | <a name="l00178"></a>00178 <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( Array<T> &array_to_load, <span class="keyword">const</span> Setting &element ) |
| 187 | <a name="l00179"></a>00179 { |
| 188 | <a name="l00180"></a>00180 <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">SettingsResolver</a> link_expander( element ); |
| 189 | <a name="l00181"></a>00181 <span class="keyword">const</span> Setting &root = link_expander.<a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html#5b09858b705318e7f23c3077fc62c199">root</a>(); |
| 190 | <a name="l00182"></a>00182 |
| 191 | <a name="l00183"></a>00183 ASSERT_UITYPE(root,TypeList); |
| 192 | <a name="l00184"></a>00184 |
| 193 | <a name="l00185"></a>00185 <span class="keywordtype">int</span> len = root.getLength(); |
| 194 | <a name="l00186"></a>00186 array_to_load.set_length( len ); |
| 195 | <a name="l00187"></a>00187 <span class="keywordflow">if</span>( len == 0 ) <span class="keywordflow">return</span>; |
| 196 | <a name="l00188"></a>00188 |
| 197 | <a name="l00189"></a>00189 <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; i < len; i++ ) |
| 198 | <a name="l00190"></a>00190 from_setting( array_to_load(i), root[i] ); |
| 199 | <a name="l00191"></a>00191 } |
| 200 | <a name="l00192"></a>00192 |
203 | | <a name="l00195"></a>00195 <span class="keyword">static</span> <span class="keywordtype">void</span> ui_error( <span class="keywordtype">string</span> message, <span class="keyword">const</span> Setting &element ); |
204 | | <a name="l00196"></a>00196 |
205 | | <a name="l00197"></a>00197 <span class="keyword">protected</span>: |
206 | | <a name="l00199"></a><a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8">00199</a> <a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8" title="default constructor">UI</a>( <span class="keyword">const</span> <span class="keywordtype">string</span>& class_name, <span class="keyword">const</span> type_info * <span class="keyword">const</span> class_type_info ) |
207 | | <a name="l00200"></a>00200 { |
208 | | <a name="l00201"></a>00201 Mapped_UI::add_class( class_name, class_type_info, <span class="keyword">this</span> ); |
209 | | <a name="l00202"></a>00202 } |
210 | | <a name="l00203"></a>00203 |
211 | | <a name="l00205"></a><a class="code" href="classbdm_1_1UI.html#95a5a0e160bf21357f99a9291b0b5e88">00205</a> <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1UI.html#95a5a0e160bf21357f99a9291b0b5e88" title="Virtual destructor for future use;.">~UI</a>(){}; |
212 | | <a name="l00206"></a>00206 |
213 | | <a name="l00207"></a>00207 <span class="keyword">public</span>: |
214 | | <a name="l00211"></a>00211 |
215 | | <a name="l00212"></a>00212 <span class="comment">// vraci true, kdyz to byl platny link, jinak false.. v pripade chyby konci it_errorem..</span> |
216 | | <a name="l00213"></a>00213 <span class="comment">// do elementu vrati setting prislusny po rozbaleni linku, jinak ponecha beze zmeny</span> |
217 | | <a name="l00214"></a><a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">00214</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">SettingsResolver</a> |
218 | | <a name="l00215"></a>00215 { |
219 | | <a name="l00216"></a>00216 <span class="keyword">private</span>: |
220 | | <a name="l00217"></a>00217 UI_File *file; |
221 | | <a name="l00218"></a>00218 <span class="keyword">const</span> Setting *result; |
222 | | <a name="l00219"></a>00219 |
223 | | <a name="l00220"></a>00220 <span class="keyword">public</span>: |
224 | | <a name="l00221"></a>00221 |
225 | | <a name="l00222"></a>00222 <a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">SettingsResolver</a>( <span class="keyword">const</span> Setting &potential_link ); |
226 | | <a name="l00223"></a>00223 |
227 | | <a name="l00224"></a>00224 ~<a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">SettingsResolver</a>(); |
228 | | <a name="l00225"></a>00225 |
229 | | <a name="l00226"></a>00226 <span class="keyword">const</span> Setting& root() <span class="keyword">const</span>; |
230 | | <a name="l00227"></a>00227 }; |
231 | | <a name="l00228"></a>00228 |
| 202 | <a name="l00195"></a>00195 |
| 203 | <a name="l00196"></a>00196 <span class="keyword">static</span> <span class="keywordtype">void</span> ui_error( <span class="keywordtype">string</span> message, <span class="keyword">const</span> Setting &element ); |
| 204 | <a name="l00197"></a>00197 |
| 205 | <a name="l00198"></a>00198 <span class="keyword">protected</span>: |
| 206 | <a name="l00200"></a><a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8">00200</a> <a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8" title="default constructor">UI</a>( <span class="keyword">const</span> <span class="keywordtype">string</span>& class_name, <span class="keyword">const</span> type_info * <span class="keyword">const</span> class_type_info ) |
| 207 | <a name="l00201"></a>00201 { |
| 208 | <a name="l00202"></a>00202 Mapped_UI::add_class( class_name, class_type_info, <span class="keyword">this</span> ); |
| 209 | <a name="l00203"></a>00203 } |
| 210 | <a name="l00204"></a>00204 |
| 211 | <a name="l00206"></a><a class="code" href="classbdm_1_1UI.html#95a5a0e160bf21357f99a9291b0b5e88">00206</a> <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1UI.html#95a5a0e160bf21357f99a9291b0b5e88" title="Virtual destructor for future use;.">~UI</a>(){}; |
| 212 | <a name="l00207"></a>00207 |
| 213 | <a name="l00208"></a>00208 <span class="keyword">public</span>: |
| 214 | <a name="l00212"></a>00212 |
| 215 | <a name="l00213"></a>00213 <span class="comment">// vraci true, kdyz to byl platny link, jinak false.. v pripade chyby konci it_errorem..</span> |
| 216 | <a name="l00214"></a>00214 <span class="comment">// do elementu vrati setting prislusny po rozbaleni linku, jinak ponecha beze zmeny</span> |
| 217 | <a name="l00215"></a><a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">00215</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">SettingsResolver</a> |
| 218 | <a name="l00216"></a>00216 { |
| 219 | <a name="l00217"></a>00217 <span class="keyword">private</span>: |
| 220 | <a name="l00218"></a>00218 UI_File *file; |
| 221 | <a name="l00219"></a>00219 <span class="keyword">const</span> Setting *result; |
| 222 | <a name="l00220"></a>00220 |
| 223 | <a name="l00221"></a>00221 <span class="keyword">public</span>: |
| 224 | <a name="l00222"></a>00222 |
| 225 | <a name="l00223"></a>00223 <a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">SettingsResolver</a>( <span class="keyword">const</span> Setting &potential_link ); |
| 226 | <a name="l00224"></a>00224 |
| 227 | <a name="l00225"></a>00225 ~<a class="code" href="classbdm_1_1UI_1_1SettingsResolver.html">SettingsResolver</a>(); |
| 228 | <a name="l00226"></a>00226 |
| 229 | <a name="l00227"></a>00227 <span class="keyword">const</span> Setting& root() <span class="keyword">const</span>; |
| 230 | <a name="l00228"></a>00228 }; |
234 | | <a name="l00232"></a><a class="code" href="classbdm_1_1UI.html#f0eccc7bbe4b680f3e1cb84b455a1125">00232</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> T* <a class="code" href="classbdm_1_1UI.html#f0eccc7bbe4b680f3e1cb84b455a1125" title="Prototype of a UI builder. Return value is by the second argument since it type checking...">build</a>( <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ) |
235 | | <a name="l00233"></a>00233 { |
236 | | <a name="l00234"></a>00234 T* instance; |
237 | | <a name="l00235"></a>00235 from_setting<T>( to_child_setting( element, index ) ); |
238 | | <a name="l00236"></a>00236 <span class="keywordflow">return</span> instance; |
239 | | <a name="l00237"></a>00237 } |
240 | | <a name="l00238"></a>00238 |
241 | | <a name="l00239"></a>00239 <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> T* <a class="code" href="classbdm_1_1UI.html#f0eccc7bbe4b680f3e1cb84b455a1125" title="Prototype of a UI builder. Return value is by the second argument since it type checking...">build</a>( <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">string</span> &name ) |
242 | | <a name="l00240"></a>00240 { |
243 | | <a name="l00241"></a>00241 T* instance; |
244 | | <a name="l00242"></a>00242 from_setting<T>( instance, to_child_setting( element, name ) ); |
245 | | <a name="l00243"></a>00243 <span class="keywordflow">return</span> instance; |
246 | | <a name="l00244"></a>00244 } |
247 | | <a name="l00245"></a>00245 |
248 | | <a name="l00247"></a><a class="code" href="classbdm_1_1UI.html#652bfd23f5052e4f1cb317057d74a3e2">00247</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( T &instance, <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">string</span> &name ) |
249 | | <a name="l00248"></a>00248 { |
250 | | <a name="l00249"></a>00249 from_setting( instance, to_child_setting( element, name ) ); |
251 | | <a name="l00250"></a>00250 } |
252 | | <a name="l00251"></a>00251 |
253 | | <a name="l00253"></a><a class="code" href="classbdm_1_1UI.html#3d04bb3d7dbcf0da0b4d5d3d5b7df51a">00253</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( T &instance, <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ) |
254 | | <a name="l00254"></a>00254 { |
255 | | <a name="l00255"></a>00255 from_setting( instance, to_child_setting( element, index ) ); |
256 | | <a name="l00256"></a>00256 } |
257 | | <a name="l00257"></a>00257 |
258 | | <a name="l00259"></a><a class="code" href="classbdm_1_1UI.html#00bb5f2a328d272b0a3ffbda1a902d54">00259</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( Array<T> &array_to_load, <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">string</span> &name ) |
259 | | <a name="l00260"></a>00260 { |
260 | | <a name="l00261"></a>00261 from_setting( array_to_load, to_child_setting( element, name ) ); |
261 | | <a name="l00262"></a>00262 } |
262 | | <a name="l00263"></a>00263 |
263 | | <a name="l00265"></a><a class="code" href="classbdm_1_1UI.html#b6a224b6aea027e167d3d565b39144e0">00265</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( Array<T> &array_to_load, <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ) |
264 | | <a name="l00266"></a>00266 { |
265 | | <a name="l00267"></a>00267 from_setting( array_to_load, to_child_setting( element, index ) ); |
266 | | <a name="l00268"></a>00268 } |
267 | | <a name="l00269"></a>00269 |
268 | | <a name="l00270"></a>00270 <span class="keyword">template</span>< <span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> save( <span class="keyword">const</span> T * <span class="keyword">const</span> instance, Setting &element, <span class="keyword">const</span> <span class="keywordtype">string</span> &name = <span class="stringliteral">""</span>) |
269 | | <a name="l00271"></a>00271 { |
270 | | <a name="l00272"></a>00272 Setting &root = (name == <span class="stringliteral">""</span>) ? element.add( Setting::TypeGroup ) |
271 | | <a name="l00273"></a>00273 : element.add( name, Setting::TypeGroup ); |
272 | | <a name="l00274"></a>00274 |
273 | | <a name="l00275"></a>00275 <span class="keyword">const</span> <span class="keywordtype">string</span> &class_name = Mapped_UI::retrieve_class_name( &<span class="keyword">typeid</span>(*instance) ); |
274 | | <a name="l00276"></a>00276 |
275 | | <a name="l00277"></a>00277 <span class="comment">// add attribute "class" </span> |
276 | | <a name="l00278"></a>00278 Setting &type = root.add( <span class="stringliteral">"class"</span>, Setting::TypeString ); |
277 | | <a name="l00279"></a>00279 type = class_name; |
278 | | <a name="l00280"></a>00280 |
279 | | <a name="l00281"></a>00281 <span class="keywordflow">try</span> |
280 | | <a name="l00282"></a>00282 { |
281 | | <a name="l00283"></a>00283 instance->to_setting( root ); |
282 | | <a name="l00284"></a>00284 } |
283 | | <a name="l00285"></a>00285 <span class="keywordflow">catch</span>(SettingException xcptn) |
284 | | <a name="l00286"></a>00286 { |
285 | | <a name="l00287"></a>00287 it_error ( <span class="stringliteral">"UI error: the method "</span> + class_name + <span class="stringliteral">".to_setting(Setting&) has thrown an exception when filling the setting "</span> + xcptn.getPath() + <span class="stringliteral">". Try to correct this method."</span> ); |
286 | | <a name="l00288"></a>00288 } |
287 | | <a name="l00289"></a>00289 } |
288 | | <a name="l00290"></a>00290 |
289 | | <a name="l00292"></a><a class="code" href="classbdm_1_1UI.html#4514f93573a9d9126c506d176fbd3163">00292</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> save( <span class="keyword">const</span> Array<T> &array_to_save, Setting &element, <span class="keyword">const</span> <span class="keywordtype">string</span> &name = <span class="stringliteral">""</span> ) |
290 | | <a name="l00293"></a>00293 { |
291 | | <a name="l00294"></a>00294 ASSERT_UITYPE(element,TypeGroup); |
292 | | <a name="l00295"></a>00295 Setting &list = (name == <span class="stringliteral">""</span>) ? element.add( Setting::TypeList ) |
293 | | <a name="l00296"></a>00296 : element.add( name, Setting::TypeList ); |
294 | | <a name="l00297"></a>00297 <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; i<array_to_save.length(); i++ ) |
295 | | <a name="l00298"></a>00298 save( array_to_save(i), list ); |
296 | | <a name="l00299"></a>00299 } |
297 | | <a name="l00300"></a>00300 |
| 233 | <a name="l00231"></a>00231 |
| 234 | <a name="l00233"></a><a class="code" href="classbdm_1_1UI.html#f0eccc7bbe4b680f3e1cb84b455a1125">00233</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> T* <a class="code" href="classbdm_1_1UI.html#f0eccc7bbe4b680f3e1cb84b455a1125" title="Prototype of a UI builder. Return value is by the second argument since it type checking...">build</a>( <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ) |
| 235 | <a name="l00234"></a>00234 { |
| 236 | <a name="l00235"></a>00235 T* instance; |
| 237 | <a name="l00236"></a>00236 from_setting<T>( to_child_setting( element, index ) ); |
| 238 | <a name="l00237"></a>00237 <span class="keywordflow">return</span> instance; |
| 239 | <a name="l00238"></a>00238 } |
| 240 | <a name="l00239"></a>00239 |
| 241 | <a name="l00240"></a>00240 <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> T* <a class="code" href="classbdm_1_1UI.html#f0eccc7bbe4b680f3e1cb84b455a1125" title="Prototype of a UI builder. Return value is by the second argument since it type checking...">build</a>( <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">string</span> &name ) |
| 242 | <a name="l00241"></a>00241 { |
| 243 | <a name="l00242"></a>00242 T* instance; |
| 244 | <a name="l00243"></a>00243 from_setting<T>( instance, to_child_setting( element, name ) ); |
| 245 | <a name="l00244"></a>00244 <span class="keywordflow">return</span> instance; |
| 246 | <a name="l00245"></a>00245 } |
| 247 | <a name="l00246"></a>00246 |
| 248 | <a name="l00248"></a><a class="code" href="classbdm_1_1UI.html#652bfd23f5052e4f1cb317057d74a3e2">00248</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( T &instance, <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">string</span> &name ) |
| 249 | <a name="l00249"></a>00249 { |
| 250 | <a name="l00250"></a>00250 from_setting( instance, to_child_setting( element, name ) ); |
| 251 | <a name="l00251"></a>00251 } |
| 252 | <a name="l00252"></a>00252 |
| 253 | <a name="l00254"></a><a class="code" href="classbdm_1_1UI.html#3d04bb3d7dbcf0da0b4d5d3d5b7df51a">00254</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( T &instance, <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ) |
| 254 | <a name="l00255"></a>00255 { |
| 255 | <a name="l00256"></a>00256 from_setting( instance, to_child_setting( element, index ) ); |
| 256 | <a name="l00257"></a>00257 } |
| 257 | <a name="l00258"></a>00258 |
| 258 | <a name="l00260"></a><a class="code" href="classbdm_1_1UI.html#00bb5f2a328d272b0a3ffbda1a902d54">00260</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( Array<T> &array_to_load, <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">string</span> &name ) |
| 259 | <a name="l00261"></a>00261 { |
| 260 | <a name="l00262"></a>00262 from_setting( array_to_load, to_child_setting( element, name ) ); |
| 261 | <a name="l00263"></a>00263 } |
| 262 | <a name="l00264"></a>00264 |
| 263 | <a name="l00266"></a><a class="code" href="classbdm_1_1UI.html#b6a224b6aea027e167d3d565b39144e0">00266</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( Array<T> &array_to_load, <span class="keyword">const</span> Setting &element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ) |
| 264 | <a name="l00267"></a>00267 { |
| 265 | <a name="l00268"></a>00268 from_setting( array_to_load, to_child_setting( element, index ) ); |
| 266 | <a name="l00269"></a>00269 } |
| 267 | <a name="l00270"></a>00270 |
| 268 | <a name="l00271"></a>00271 <span class="keyword">template</span>< <span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> save( <span class="keyword">const</span> T * <span class="keyword">const</span> instance, Setting &element, <span class="keyword">const</span> <span class="keywordtype">string</span> &name = <span class="stringliteral">""</span>) |
| 269 | <a name="l00272"></a>00272 { |
| 270 | <a name="l00273"></a>00273 Setting &root = (name == <span class="stringliteral">""</span>) ? element.add( Setting::TypeGroup ) |
| 271 | <a name="l00274"></a>00274 : element.add( name, Setting::TypeGroup ); |
| 272 | <a name="l00275"></a>00275 |
| 273 | <a name="l00276"></a>00276 <span class="keyword">const</span> <span class="keywordtype">string</span> &class_name = Mapped_UI::retrieve_class_name( &<span class="keyword">typeid</span>(*instance) ); |
| 274 | <a name="l00277"></a>00277 |
| 275 | <a name="l00278"></a>00278 <span class="comment">// add attribute "class" </span> |
| 276 | <a name="l00279"></a>00279 Setting &type = root.add( <span class="stringliteral">"class"</span>, Setting::TypeString ); |
| 277 | <a name="l00280"></a>00280 type = class_name; |
| 278 | <a name="l00281"></a>00281 |
| 279 | <a name="l00282"></a>00282 <span class="keywordflow">try</span> |
| 280 | <a name="l00283"></a>00283 { |
| 281 | <a name="l00284"></a>00284 instance->to_setting( root ); |
| 282 | <a name="l00285"></a>00285 } |
| 283 | <a name="l00286"></a>00286 <span class="keywordflow">catch</span>(SettingException xcptn) |
| 284 | <a name="l00287"></a>00287 { |
| 285 | <a name="l00288"></a>00288 it_error ( <span class="stringliteral">"UI error: the method "</span> + class_name + <span class="stringliteral">".to_setting(Setting&) has thrown an exception when filling the setting "</span> + xcptn.getPath() + <span class="stringliteral">". Try to correct this method."</span> ); |
| 286 | <a name="l00289"></a>00289 } |
| 287 | <a name="l00290"></a>00290 } |
| 288 | <a name="l00291"></a>00291 |
| 289 | <a name="l00293"></a><a class="code" href="classbdm_1_1UI.html#4514f93573a9d9126c506d176fbd3163">00293</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">static</span> <span class="keywordtype">void</span> save( <span class="keyword">const</span> Array<T> &array_to_save, Setting &element, <span class="keyword">const</span> <span class="keywordtype">string</span> &name = <span class="stringliteral">""</span> ) |
| 290 | <a name="l00294"></a>00294 { |
| 291 | <a name="l00295"></a>00295 ASSERT_UITYPE(element,TypeGroup); |
| 292 | <a name="l00296"></a>00296 Setting &list = (name == <span class="stringliteral">""</span>) ? element.add( Setting::TypeList ) |
| 293 | <a name="l00297"></a>00297 : element.add( name, Setting::TypeList ); |
| 294 | <a name="l00298"></a>00298 <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; i<array_to_save.length(); i++ ) |
| 295 | <a name="l00299"></a>00299 save( array_to_save(i), list ); |
| 296 | <a name="l00300"></a>00300 } |
311 | | <a name="l00322"></a><a class="code" href="classbdm_1_1Particular__UI.html">00322</a> <span class="keyword">template</span><<span class="keyword">typename</span> T> <span class="keyword">class </span><a class="code" href="classbdm_1_1Particular__UI.html" title="The main userinfo template class. You should derive this class whenever you need...">Particular_UI</a> : <span class="keyword">private</span> <a class="code" href="classbdm_1_1UI.html" title="This class serves to load and/or save DOMElements into/from files stored on a hard-disk...">UI</a> |
312 | | <a name="l00323"></a>00323 { |
313 | | <a name="l00324"></a>00324 <span class="keyword">public</span>: |
314 | | <a name="l00325"></a>00325 |
315 | | <a name="l00327"></a>00327 <a class="code" href="classbdm_1_1Particular__UI.html" title="The main userinfo template class. You should derive this class whenever you need...">Particular_UI<T></a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &class_name) : <a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8" title="default constructor">UI</a>( class_name, &<span class="keyword">typeid</span>(T) ) |
316 | | <a name="l00328"></a>00328 { cout << class_name << endl; |
317 | | <a name="l00329"></a><a class="code" href="classbdm_1_1Particular__UI.html#ca33b00e0c341706003930c4b20a1e36">00329</a> }; |
318 | | <a name="l00330"></a>00330 |
319 | | <a name="l00333"></a>00333 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classbdm_1_1Particular__UI.html" title="The main userinfo template class. You should derive this class whenever you need...">Particular_UI<T></a>& <a class="code" href="classbdm_1_1Particular__UI.html#ca33b00e0c341706003930c4b20a1e36">ui</a>; |
320 | | <a name="l00334"></a>00334 |
321 | | <a name="l00335"></a><a class="code" href="classbdm_1_1Particular__UI.html#6ae004150ae2de7645c62219c74340ff">00335</a> <a class="code" href="classbdm_1_1bdmroot.html" title="Root class of BDM objects.">bdmroot</a>* <a class="code" href="classbdm_1_1Particular__UI.html#6ae004150ae2de7645c62219c74340ff" title="internal method assembling a typeless instance from components obtained by the &#39;AssemblyComponen...">new_instance</a>()<span class="keyword"> const</span> |
322 | | <a name="l00336"></a>00336 <span class="keyword"> </span>{ |
323 | | <a name="l00337"></a>00337 <span class="keywordflow">return</span> <span class="keyword">new</span> T(); |
324 | | <a name="l00338"></a>00338 } |
325 | | <a name="l00339"></a>00339 }; |
326 | | <a name="l00340"></a>00340 |
| 310 | <a name="l00317"></a>00317 |
| 311 | <a name="l00323"></a><a class="code" href="classbdm_1_1Particular__UI.html">00323</a> <span class="keyword">template</span><<span class="keyword">typename</span> T> <span class="keyword">class </span><a class="code" href="classbdm_1_1Particular__UI.html" title="The main userinfo template class. You should derive this class whenever you need...">Particular_UI</a> : <span class="keyword">private</span> <a class="code" href="classbdm_1_1UI.html" title="This class serves to load and/or save DOMElements into/from files stored on a hard-disk...">UI</a> |
| 312 | <a name="l00324"></a>00324 { |
| 313 | <a name="l00325"></a>00325 <span class="keyword">public</span>: |
| 314 | <a name="l00326"></a>00326 |
| 315 | <a name="l00328"></a>00328 <a class="code" href="classbdm_1_1Particular__UI.html" title="The main userinfo template class. You should derive this class whenever you need...">Particular_UI<T></a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &class_name) : <a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8" title="default constructor">UI</a>( class_name, &<span class="keyword">typeid</span>(T) ) |
| 316 | <a name="l00329"></a>00329 { cout << class_name << endl; |
| 317 | <a name="l00330"></a><a class="code" href="classbdm_1_1Particular__UI.html#ca33b00e0c341706003930c4b20a1e36">00330</a> }; |
| 318 | <a name="l00331"></a>00331 |
| 319 | <a name="l00334"></a>00334 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classbdm_1_1Particular__UI.html" title="The main userinfo template class. You should derive this class whenever you need...">Particular_UI<T></a>& <a class="code" href="classbdm_1_1Particular__UI.html#ca33b00e0c341706003930c4b20a1e36">ui</a>; |
| 320 | <a name="l00335"></a>00335 |
| 321 | <a name="l00336"></a><a class="code" href="classbdm_1_1Particular__UI.html#6ae004150ae2de7645c62219c74340ff">00336</a> <a class="code" href="classbdm_1_1bdmroot.html" title="Root class of BDM objects.">bdmroot</a>* <a class="code" href="classbdm_1_1Particular__UI.html#6ae004150ae2de7645c62219c74340ff" title="internal method assembling a typeless instance from components obtained by the &#39;AssemblyComponen...">new_instance</a>()<span class="keyword"> const</span> |
| 322 | <a name="l00337"></a>00337 <span class="keyword"> </span>{ |
| 323 | <a name="l00338"></a>00338 <span class="keywordflow">return</span> <span class="keyword">new</span> T(); |
| 324 | <a name="l00339"></a>00339 } |
| 325 | <a name="l00340"></a>00340 }; |