Show
Ignore:
Timestamp:
08/16/09 18:14:04 (15 years ago)
Author:
smidl
Message:

Documentation regenerated

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/doc/html/user__info_8h-source.html

    r401 r538  
    5252      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li> 
    5353      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> 
    54       <li><a href="modules.html"><span>Modules</span></a></li> 
    5554      <li><a href="annotated.html"><span>Classes</span></a></li> 
    5655      <li class="current"><a href="files.html"><span>Files</span></a></li> 
     
    6463  </div> 
    6564<h1>user_info.h</h1><a href="user__info_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001  
    66 <a name="l00014"></a>00014 <span class="preprocessor">#ifndef USER_INFO_H</span> 
    67 <a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#define USER_INFO_H</span> 
    68 <a name="l00016"></a>00016 <span class="preprocessor"></span> 
    69 <a name="l00017"></a>00017 <span class="preprocessor">#include &lt;stdio.h&gt;</span> 
    70 <a name="l00018"></a>00018 <span class="preprocessor">#include &lt;string&gt;</span> 
    71 <a name="l00019"></a>00019 <span class="preprocessor">#include &lt;typeinfo&gt;</span> 
    72 <a name="l00020"></a>00020 <span class="preprocessor">#include &lt;map&gt;</span> 
    73 <a name="l00021"></a>00021 <span class="preprocessor">#include &lt;stdexcept&gt;</span> 
    74 <a name="l00022"></a>00022  
    75 <a name="l00023"></a>00023 <span class="preprocessor">#include "libconfig/libconfig.h++"</span> 
    76 <a name="l00024"></a>00024 <span class="preprocessor">#include "../bdmroot.h"</span> 
    77 <a name="l00025"></a>00025 <span class="preprocessor">#include "itpp/itbase.h"</span> 
    78 <a name="l00026"></a>00026  
    79 <a name="l00027"></a>00027  
    80 <a name="l00028"></a>00028 <span class="keyword">using</span> std::string; 
    81 <a name="l00029"></a>00029 <span class="keyword">using namespace </span>std; 
    82 <a name="l00030"></a>00030 <span class="keyword">using namespace </span>libconfig; 
    83 <a name="l00031"></a>00031  
    84 <a name="l00032"></a>00032 <span class="keyword">namespace </span>bdm 
    85 <a name="l00033"></a>00033 { 
    86 <a name="l00034"></a>00034          
    87 <a name="l00044"></a>00044 <span class="preprocessor">#ifndef BDMLIB </span> 
    88 <a name="l00045"></a><a class="code" href="user__info_8h.html#4f9de2f17e844047726487b99def99c6">00045</a> <span class="preprocessor"></span><span class="preprocessor">        #define UIREGISTER(class_name) template&lt;&gt; const ParticularUI&lt;class_name&gt;&amp; ParticularUI&lt;class_name&gt;::factory = ParticularUI&lt;class_name&gt;(#class_name) </span> 
    89 <a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#else</span> 
    90 <a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">        #define UIREGISTER(class_name)</span> 
    91 <a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#endif</span> 
    92 <a name="l00049"></a>00049 <span class="preprocessor"></span> 
    93 <a name="l00051"></a><a class="code" href="classbdm_1_1UIException.html">00051</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1UIException.html" title="Exception prepared for reporting user-info errors which are always related to some...">UIException</a> : <span class="keyword">public</span> std::exception 
    94 <a name="l00052"></a>00052 { 
    95 <a name="l00053"></a>00053 <span class="keyword">private</span>: 
    96 <a name="l00055"></a>00055         <span class="keyword">const</span> <span class="keywordtype">string</span> message; 
    97 <a name="l00056"></a>00056  
    98 <a name="l00057"></a>00057 <span class="keyword">public</span>: 
    99 <a name="l00059"></a><a class="code" href="classbdm_1_1UIException.html#351bfe4a6e8d0288500e3412313f3301">00059</a>         <a class="code" href="classbdm_1_1UIException.html#351bfe4a6e8d0288500e3412313f3301" title="Use this constructor when you can pass the problematical Setting as a parameter.">UIException</a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;message, <span class="keyword">const</span> Setting &amp;element  )  
    100 <a name="l00060"></a>00060                 : message( <span class="stringliteral">"UI error: "</span> + message + <span class="stringliteral">". Check path \""</span> + string(element.getPath()) + <span class="stringliteral">"\"."</span> ) 
    101 <a name="l00061"></a>00061         { 
     65<a name="l00015"></a>00015 <span class="preprocessor">#ifndef USER_INFO_H</span> 
     66<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define USER_INFO_H</span> 
     67<a name="l00017"></a>00017 <span class="preprocessor"></span> 
     68<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;stdio.h&gt;</span> 
     69<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;string&gt;</span> 
     70<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;typeinfo&gt;</span> 
     71<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;map&gt;</span> 
     72<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;stdexcept&gt;</span> 
     73<a name="l00023"></a>00023  
     74<a name="l00024"></a>00024 <span class="preprocessor">#include "libconfig/libconfig.h++"</span> 
     75<a name="l00025"></a>00025 <span class="preprocessor">#include "../bdmroot.h"</span> 
     76<a name="l00026"></a>00026 <span class="preprocessor">#include "../shared_ptr.h"</span> 
     77<a name="l00027"></a>00027 <span class="preprocessor">#include "itpp/itbase.h"</span> 
     78<a name="l00028"></a>00028  
     79<a name="l00029"></a>00029  
     80<a name="l00030"></a>00030 <span class="keyword">using</span> std::string; 
     81<a name="l00031"></a>00031 <span class="keyword">using namespace </span>std; 
     82<a name="l00032"></a>00032 <span class="keyword">using namespace </span>libconfig; 
     83<a name="l00033"></a>00033  
     84<a name="l00034"></a>00034 <span class="keyword">namespace </span>bdm { 
     85<a name="l00035"></a>00035  
     86<a name="l00039"></a><a class="code" href="classbdm_1_1UIException.html">00039</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1UIException.html">UIException</a> : <span class="keyword">public</span> std::exception { 
     87<a name="l00040"></a>00040  
     88<a name="l00041"></a>00041 <span class="keyword">public</span>: 
     89<a name="l00043"></a><a class="code" href="classbdm_1_1UIException.html#82b5104b04c1ed5047a7a344dc702f68">00043</a>         <span class="keyword">const</span> <span class="keywordtype">string</span> <a class="code" href="classbdm_1_1UIException.html#82b5104b04c1ed5047a7a344dc702f68" title="Error message.">message</a>; 
     90<a name="l00044"></a>00044  
     91<a name="l00046"></a><a class="code" href="classbdm_1_1UIException.html#c25dbbe6c642e5a70a810673ab9929d2">00046</a>         <span class="keyword">const</span> <span class="keywordtype">string</span> <a class="code" href="classbdm_1_1UIException.html#c25dbbe6c642e5a70a810673ab9929d2" title="Path to the problematic setting.">path</a>; 
     92<a name="l00047"></a>00047  
     93<a name="l00048"></a>00048 <span class="keyword">private</span>: 
     94<a name="l00049"></a>00049         <span class="keywordtype">string</span> what_message; 
     95<a name="l00050"></a>00050  
     96<a name="l00051"></a>00051 <span class="keyword">public</span>: 
     97<a name="l00053"></a><a class="code" href="classbdm_1_1UIException.html#351bfe4a6e8d0288500e3412313f3301">00053</a>         <a class="code" href="classbdm_1_1UIException.html#351bfe4a6e8d0288500e3412313f3301" title="Use this constructor when you can pass the problematical Setting as a parameter.">UIException</a> ( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;<a class="code" href="classbdm_1_1UIException.html#82b5104b04c1ed5047a7a344dc702f68" title="Error message.">message</a>, <span class="keyword">const</span> Setting &amp;element ) 
     98<a name="l00054"></a>00054                         : message ( <span class="stringliteral">"UI error: "</span> + message + <span class="stringliteral">"."</span> ), <a class="code" href="classbdm_1_1UIException.html#c25dbbe6c642e5a70a810673ab9929d2" title="Path to the problematic setting.">path</a> ( <span class="stringliteral">"Check path \""</span> + string ( element.getPath() ) + <span class="stringliteral">"\"."</span> ) { 
     99<a name="l00055"></a>00055                 init_what_message(); 
     100<a name="l00056"></a>00056         } 
     101<a name="l00057"></a>00057  
     102<a name="l00059"></a><a class="code" href="classbdm_1_1UIException.html#691e5563c06a1d4d9e02e01a1a187dae">00059</a>         <a class="code" href="classbdm_1_1UIException.html#351bfe4a6e8d0288500e3412313f3301" title="Use this constructor when you can pass the problematical Setting as a parameter.">UIException</a> ( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;<a class="code" href="classbdm_1_1UIException.html#82b5104b04c1ed5047a7a344dc702f68" title="Error message.">message</a>, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;<a class="code" href="classbdm_1_1UIException.html#c25dbbe6c642e5a70a810673ab9929d2" title="Path to the problematic setting.">path</a> ) 
     103<a name="l00060"></a>00060                         : message ( <span class="stringliteral">"UI error: "</span> + message + <span class="stringliteral">"."</span> ), path ( <span class="stringliteral">"Check path \""</span> + path + <span class="stringliteral">"\"."</span> ) { 
     104<a name="l00061"></a>00061                 init_what_message(); 
    102105<a name="l00062"></a>00062         } 
    103106<a name="l00063"></a>00063  
    104 <a name="l00065"></a><a class="code" href="classbdm_1_1UIException.html#691e5563c06a1d4d9e02e01a1a187dae">00065</a>         <a class="code" href="classbdm_1_1UIException.html#351bfe4a6e8d0288500e3412313f3301" title="Use this constructor when you can pass the problematical Setting as a parameter.">UIException</a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;message, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;path  )  
    105 <a name="l00066"></a>00066                 : message( <span class="stringliteral">"UI error: "</span> + message + <span class="stringliteral">"! Check path \""</span> + path + <span class="stringliteral">"\"."</span> ) 
    106 <a name="l00067"></a>00067         { 
    107 <a name="l00068"></a>00068         } 
    108 <a name="l00069"></a>00069  
    109 <a name="l00071"></a><a class="code" href="classbdm_1_1UIException.html#1bf477e4ea19abb638fe5b883f09218e">00071</a>         <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classbdm_1_1UIException.html#1bf477e4ea19abb638fe5b883f09218e" title="Overriden method for reporting an error message.">what</a>() <span class="keyword">const</span> throw() 
    110 <a name="l00072"></a>00072         { 
    111 <a name="l00073"></a>00073                 <span class="keywordflow">return</span> message.c_str(); 
    112 <a name="l00074"></a>00074         } 
    113 <a name="l00075"></a>00075         ~<a class="code" href="classbdm_1_1UIException.html" title="Exception prepared for reporting user-info errors which are always related to some...">UIException</a>() throw() {}; 
    114 <a name="l00076"></a>00076 }; 
    115 <a name="l00077"></a>00077  
     107<a name="l00065"></a><a class="code" href="classbdm_1_1UIException.html#1bf477e4ea19abb638fe5b883f09218e">00065</a>         <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classbdm_1_1UIException.html#1bf477e4ea19abb638fe5b883f09218e" title="Overriden method for reporting an error message.">what</a>() <span class="keyword">const</span> throw() { 
     108<a name="l00066"></a>00066                 <span class="keywordflow">return</span> what_message.c_str(); 
     109<a name="l00067"></a>00067         } 
     110<a name="l00068"></a>00068  
     111<a name="l00069"></a>00069         ~<a class="code" href="classbdm_1_1UIException.html">UIException</a>() throw() {}; 
     112<a name="l00070"></a>00070  
     113<a name="l00071"></a>00071 <span class="keyword">private</span>: 
     114<a name="l00072"></a>00072         <span class="keywordtype">void</span> init_what_message() { 
     115<a name="l00073"></a>00073                 what_message = <a class="code" href="classbdm_1_1UIException.html#82b5104b04c1ed5047a7a344dc702f68" title="Error message.">message</a>; 
     116<a name="l00074"></a>00074                 what_message += <span class="charliteral">' '</span>; 
     117<a name="l00075"></a>00075                 what_message += <a class="code" href="classbdm_1_1UIException.html#c25dbbe6c642e5a70a810673ab9929d2" title="Path to the problematic setting.">path</a>; 
     118<a name="l00076"></a>00076         } 
     119<a name="l00077"></a>00077 }; 
    116120<a name="l00078"></a>00078  
    117 <a name="l00101"></a><a class="code" href="classbdm_1_1UIFile.html">00101</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1UIFile.html" title="This class serves to load and/or save user-infos into/from configuration files stored...">UIFile</a> : <span class="keyword">public</span> Config 
    118 <a name="l00102"></a>00102 { 
    119 <a name="l00103"></a>00103 <span class="keyword">public</span>: 
    120 <a name="l00105"></a>00105         <a class="code" href="classbdm_1_1UIFile.html#77274c827f87f16bd6671df8a0cc1e33" title="Create empty file instance prepared to store Settings.">UIFile</a>(); 
    121 <a name="l00106"></a>00106  
    122 <a name="l00108"></a>00108         <a class="code" href="classbdm_1_1UIFile.html#77274c827f87f16bd6671df8a0cc1e33" title="Create empty file instance prepared to store Settings.">UIFile</a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;file_name ); 
    123 <a name="l00109"></a>00109  
    124 <a name="l00111"></a>00111         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UIFile.html#1f8af28a0d8ef1a4956e198df0beb5ba" title="Save all the stored Settings into the configuration file file_name.">save</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;file_name); 
    125 <a name="l00112"></a>00112  
    126 <a name="l00114"></a>00114         <a class="code" href="classbdm_1_1UIFile.html#5bce10d88c71f6147d58baa8400ff61f" title="This operator allows the ability of substituting Setting parameter by UIFile instance...">operator Setting&amp;</a>(); 
    127 <a name="l00115"></a>00115 }; 
    128 <a name="l00116"></a>00116  
    129 <a name="l00181"></a><a class="code" href="classbdm_1_1SettingResolver.html">00181</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1SettingResolver.html" title="This class serves to expand links used within configuration files.">SettingResolver</a> : <a class="code" href="classbdm_1_1root.html" title="Root class of BDM objects.">root</a> 
    130 <a name="l00182"></a>00182 { 
    131 <a name="l00183"></a>00183 <span class="keyword">private</span>: 
    132 <a name="l00185"></a>00185         <a class="code" href="classbdm_1_1UIFile.html" title="This class serves to load and/or save user-infos into/from configuration files stored...">UIFile</a> *file; 
    133 <a name="l00186"></a>00186  
    134 <a name="l00192"></a>00192         <span class="keyword">const</span> Setting &amp;initialize_reference( <a class="code" href="classbdm_1_1UIFile.html" title="This class serves to load and/or save user-infos into/from configuration files stored...">UIFile</a>* &amp;file, <span class="keyword">const</span> Setting &amp;potential_link); 
    135 <a name="l00193"></a>00193  
    136 <a name="l00194"></a>00194 <span class="keyword">public</span>: 
    137 <a name="l00196"></a><a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498">00196</a>         <span class="keyword">const</span> Setting &amp;<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>; 
    138 <a name="l00197"></a>00197  
    139 <a name="l00199"></a>00199         <a class="code" href="classbdm_1_1SettingResolver.html#e2299746b95bf8af54a867aaf52fc8da" title="If potential_link contains a link to some other setting, it is resolved here. Anyway...">SettingResolver</a>( <span class="keyword">const</span> Setting &amp;potential_link ); 
    140 <a name="l00200"></a>00200          
    141 <a name="l00202"></a>00202         <a class="code" href="classbdm_1_1SettingResolver.html#c8b29999710e2db98c1a3979e25e6bbc" title="An opened UIFile file is closed here if necessary.">~SettingResolver</a>();              
    142 <a name="l00203"></a>00203 }; 
    143 <a name="l00204"></a>00204  
    144 <a name="l00212"></a><a class="code" href="classbdm_1_1UI.html">00212</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1UI.html" title="UI is an abstract class and it is intended for internal purposes only.">UI</a>  
    145 <a name="l00213"></a>00213 { 
    146 <a name="l00214"></a>00214 <span class="keyword">private</span>: 
    147 <a name="l00220"></a>00220         <span class="keyword">class </span>MappedUI 
    148 <a name="l00221"></a>00221         { 
    149 <a name="l00222"></a>00222         <span class="keyword">private</span>: 
    150 <a name="l00224"></a>00224                 <span class="keyword">typedef</span> map&lt; const string, const UI* const &gt; StringToUIMap; 
    151 <a name="l00225"></a>00225  
    152 <a name="l00227"></a>00227                 <span class="keyword">typedef</span> map&lt; const type_info * const, const string &gt; TypeInfoToStringMap; 
    153 <a name="l00228"></a>00228  
    154 <a name="l00230"></a>00230                 <span class="keyword">static</span> StringToUIMap&amp; mapped_strings(); 
    155 <a name="l00231"></a>00231  
    156 <a name="l00233"></a>00233                 <span class="keyword">static</span> TypeInfoToStringMap&amp; mapped_type_infos(); 
    157 <a name="l00234"></a>00234  
    158 <a name="l00236"></a>00236                 <span class="keyword">static</span> <span class="keywordtype">void</span> unregistered_class_error( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;unregistered_class_name ); 
    159 <a name="l00237"></a>00237  
    160 <a name="l00238"></a>00238         <span class="keyword">public</span>: 
    161 <a name="l00240"></a>00240                 <span class="keyword">static</span> <span class="keywordtype">void</span> add_class( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;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="UI is an abstract class and it is intended for internal purposes only.">UI</a>* <span class="keyword">const</span> ui ); 
     121<a name="l00079"></a>00079  
     122<a name="l00104"></a><a class="code" href="classbdm_1_1UIFile.html">00104</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1UIFile.html" title="This class serves to load and/or save user-infos into/from configuration files stored...">UIFile</a> : <span class="keyword">public</span> Config { 
     123<a name="l00105"></a>00105 <span class="keyword">public</span>: 
     124<a name="l00107"></a>00107         <a class="code" href="classbdm_1_1UIFile.html#77274c827f87f16bd6671df8a0cc1e33" title="Create empty file instance prepared to store Settings.">UIFile</a>(); 
     125<a name="l00108"></a>00108  
     126<a name="l00110"></a>00110         <a class="code" href="classbdm_1_1UIFile.html#77274c827f87f16bd6671df8a0cc1e33" title="Create empty file instance prepared to store Settings.">UIFile</a> ( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;file_name ); 
     127<a name="l00111"></a>00111  
     128<a name="l00113"></a>00113         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UIFile.html#1f8af28a0d8ef1a4956e198df0beb5ba" title="Save all the stored Settings into the configuration file file_name.">save</a> ( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;file_name ); 
     129<a name="l00114"></a>00114  
     130<a name="l00116"></a>00116         <a class="code" href="classbdm_1_1UIFile.html#5bce10d88c71f6147d58baa8400ff61f" title="This operator allows the ability of substituting Setting parameter by UIFile instance...">operator Setting&amp;</a>(); 
     131<a name="l00117"></a>00117 }; 
     132<a name="l00118"></a>00118  
     133<a name="l00185"></a><a class="code" href="classbdm_1_1SettingResolver.html">00185</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1SettingResolver.html" title="This class serves to expand links used within configuration files.">SettingResolver</a> : <a class="code" href="classbdm_1_1root.html" title="Root class of BDM objects.">root</a> { 
     134<a name="l00186"></a>00186 <span class="keyword">private</span>: 
     135<a name="l00188"></a>00188         <a class="code" href="classbdm_1_1UIFile.html" title="This class serves to load and/or save user-infos into/from configuration files stored...">UIFile</a> *file; 
     136<a name="l00189"></a>00189  
     137<a name="l00195"></a>00195         <span class="keyword">const</span> Setting &amp;initialize_reference ( <a class="code" href="classbdm_1_1UIFile.html" title="This class serves to load and/or save user-infos into/from configuration files stored...">UIFile</a>* &amp;file, <span class="keyword">const</span> Setting &amp;potential_link ); 
     138<a name="l00196"></a>00196  
     139<a name="l00197"></a>00197 <span class="keyword">public</span>: 
     140<a name="l00199"></a><a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498">00199</a>         <span class="keyword">const</span> Setting &amp;<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>; 
     141<a name="l00200"></a>00200  
     142<a name="l00202"></a>00202         <a class="code" href="classbdm_1_1SettingResolver.html#e2299746b95bf8af54a867aaf52fc8da" title="If potential_link contains a link to some other setting, it is resolved here. Anyway...">SettingResolver</a> ( <span class="keyword">const</span> Setting &amp;potential_link ); 
     143<a name="l00203"></a>00203  
     144<a name="l00205"></a>00205         <a class="code" href="classbdm_1_1SettingResolver.html#c8b29999710e2db98c1a3979e25e6bbc" title="An opened UIFile file is closed here if necessary.">~SettingResolver</a>(); 
     145<a name="l00206"></a>00206 }; 
     146<a name="l00207"></a>00207  
     147<a name="l00218"></a><a class="code" href="classbdm_1_1UI.html">00218</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1UI.html" title="UI is an abstract class which collects all the auxiliary functions useful to prepare...">UI</a> { 
     148<a name="l00219"></a>00219 <span class="keyword">private</span>: 
     149<a name="l00225"></a>00225         <span class="keyword">class </span>MappedUI { 
     150<a name="l00226"></a>00226         <span class="keyword">private</span>: 
     151<a name="l00228"></a>00228                 <span class="keyword">typedef</span> map&lt; const string, const UI* const &gt; StringToUIMap; 
     152<a name="l00229"></a>00229  
     153<a name="l00231"></a>00231                 <span class="keyword">typedef</span> map&lt; const type_info * const, const string &gt; TypeInfoToStringMap; 
     154<a name="l00232"></a>00232  
     155<a name="l00234"></a>00234                 <span class="keyword">static</span> StringToUIMap&amp; mapped_strings(); 
     156<a name="l00235"></a>00235  
     157<a name="l00237"></a>00237                 <span class="keyword">static</span> TypeInfoToStringMap&amp; mapped_type_infos(); 
     158<a name="l00238"></a>00238  
     159<a name="l00240"></a>00240                 <span class="keyword">static</span> <span class="keywordtype">void</span> unregistered_class_error ( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;unregistered_class_name ); 
    162160<a name="l00241"></a>00241  
    163 <a name="l00243"></a>00243                 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI.html" title="UI is an abstract class and it is intended for internal purposes only.">UI</a>&amp; retrieve_ui( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;class_name ); 
    164 <a name="l00244"></a>00244  
    165 <a name="l00246"></a>00246                 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; retrieve_class_name( <span class="keyword">const</span> type_info* <span class="keyword">const</span> class_type_info ); 
    166 <a name="l00247"></a>00247         }; 
     161<a name="l00242"></a>00242         <span class="keyword">public</span>: 
     162<a name="l00244"></a>00244                 <span class="keyword">static</span> <span class="keywordtype">void</span> add_class ( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;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="UI is an abstract class which collects all the auxiliary functions useful to prepare...">UI</a>* <span class="keyword">const</span> ui ); 
     163<a name="l00245"></a>00245  
     164<a name="l00247"></a>00247                 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI.html" title="UI is an abstract class which collects all the auxiliary functions useful to prepare...">UI</a>&amp; retrieve_ui ( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;class_name ); 
    167165<a name="l00248"></a>00248  
    168 <a name="l00250"></a>00250         <span class="keyword">static</span> <span class="keywordtype">void</span> assert_type( <span class="keyword">const</span> Setting &amp;element, Setting::Type type); 
    169 <a name="l00251"></a>00251  
    170 <a name="l00253"></a>00253         <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1root.html" title="Root class of BDM objects.">root</a>* new_instance() <span class="keyword">const</span> = 0; 
    171 <a name="l00254"></a>00254          
    172 <a name="l00256"></a>00256         <span class="keyword">static</span> <span class="keyword">const</span> Setting&amp; to_child_setting( <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ); 
    173 <a name="l00257"></a>00257  
    174 <a name="l00259"></a>00259         <span class="keyword">static</span> <span class="keyword">const</span> Setting&amp; to_child_setting( <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name ); 
    175 <a name="l00260"></a>00260  
    176 <a name="l00262"></a>00262         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( mat&amp; matrix, <span class="keyword">const</span> Setting &amp;element );         
    177 <a name="l00264"></a>00264         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( ivec &amp;vector, <span class="keyword">const</span> Setting &amp;element ); 
    178 <a name="l00266"></a>00266         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( <span class="keywordtype">string</span> &amp;<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 &amp;element ); 
    179 <a name="l00268"></a>00268         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( vec &amp;vector, <span class="keyword">const</span> Setting &amp;element ); 
    180 <a name="l00270"></a>00270         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( <span class="keywordtype">int</span> &amp;integer, <span class="keyword">const</span> Setting &amp;element ); 
    181 <a name="l00272"></a>00272         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( <span class="keywordtype">double</span> &amp;real, <span class="keyword">const</span> Setting &amp;element ); 
    182 <a name="l00274"></a>00274         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( T* &amp;instance, <span class="keyword">const</span> Setting &amp;element ) 
    183 <a name="l00275"></a>00275         {                        
    184 <a name="l00276"></a>00276                 <span class="keyword">const</span> <a class="code" href="classbdm_1_1SettingResolver.html" title="This class serves to expand links used within configuration files.">SettingResolver</a> link( element ); 
    185 <a name="l00277"></a>00277                 assert_type(link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>,Setting::TypeGroup); 
    186 <a name="l00278"></a>00278  
    187 <a name="l00279"></a>00279                 <span class="comment">// we get a value stored in the "class" attribute </span> 
    188 <a name="l00280"></a>00280                 <span class="keywordtype">string</span> class_name; 
    189 <a name="l00281"></a>00281                 <span class="keywordflow">if</span>( !link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>.lookupValue( <span class="stringliteral">"class"</span>, class_name ) ) 
    190 <a name="l00282"></a>00282                         <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html" title="Exception prepared for reporting user-info errors which are always related to some...">UIException</a>( <span class="stringliteral">"the obligatory \"class\" identifier is missing"</span>, link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a> ); 
    191 <a name="l00283"></a>00283          
    192 <a name="l00284"></a>00284                 <span class="comment">// then we find a user-info related to this type</span> 
    193 <a name="l00285"></a>00285                 <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI.html" title="UI is an abstract class and it is intended for internal purposes only.">UI</a>&amp; related_UI = MappedUI::retrieve_ui( class_name ); 
    194 <a name="l00286"></a>00286                  
    195 <a name="l00287"></a>00287                 <a class="code" href="classbdm_1_1root.html" title="Root class of BDM objects.">root</a>* typeless_instance = related_UI.<a class="code" href="classbdm_1_1UI.html#77291f28a4b951522ae5f6a03121b635" title="Method assembling a typeless instance, it is implemented in descendant class ParticularUI&amp;lt;T&amp;gt;...">new_instance</a>(); 
    196 <a name="l00288"></a>00288  
    197 <a name="l00289"></a>00289                 instance = <span class="keyword">dynamic_cast&lt;</span>T*<span class="keyword">&gt;</span>(typeless_instance); 
    198 <a name="l00290"></a>00290                 <span class="keywordflow">if</span> (!instance) 
    199 <a name="l00291"></a>00291                         <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html" title="Exception prepared for reporting user-info errors which are always related to some...">UIException</a>( <span class="stringliteral">"class "</span> + class_name + <span class="stringliteral">" is not a descendant of the desired output class. Try to call the UI::build&lt;T&gt; function with a different type parameter."</span>, link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a> ); 
    200 <a name="l00292"></a>00292                  
    201 <a name="l00293"></a>00293                 <span class="keywordflow">try</span> 
    202 <a name="l00294"></a>00294                 { 
    203 <a name="l00295"></a>00295                         instance-&gt;from_setting( link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a> ); 
    204 <a name="l00296"></a>00296                 } 
    205 <a name="l00297"></a>00297                 <span class="keywordflow">catch</span>(SettingException xcptn) 
    206 <a name="l00298"></a>00298                 { 
    207 <a name="l00299"></a>00299                         <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html" title="Exception prepared for reporting user-info errors which are always related to some...">UIException</a>( <span class="stringliteral">"the method "</span> + class_name + <span class="stringliteral">".from_setting(Setting&amp;) has thrown an SettingException. Try to correct this method"</span>, xcptn.getPath()); 
    208 <a name="l00300"></a>00300                 } 
    209 <a name="l00301"></a>00301         }        
    210 <a name="l00302"></a>00302  
    211 <a name="l00304"></a>00304         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting( Array&lt;T&gt; &amp;array_to_load, <span class="keyword">const</span> Setting &amp;element ) 
    212 <a name="l00305"></a>00305         { 
    213 <a name="l00306"></a>00306                 <span class="keyword">const</span> <a class="code" href="classbdm_1_1SettingResolver.html" title="This class serves to expand links used within configuration files.">SettingResolver</a> link( element ); 
    214 <a name="l00307"></a>00307  
    215 <a name="l00308"></a>00308                 assert_type(link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>,Setting::TypeList); 
    216 <a name="l00309"></a>00309  
    217 <a name="l00310"></a>00310                 <span class="keywordtype">int</span> len = link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>.getLength(); 
    218 <a name="l00311"></a>00311                 array_to_load.set_length( len ); 
    219 <a name="l00312"></a>00312                 <span class="keywordflow">if</span>( len == 0 ) <span class="keywordflow">return</span>; 
    220 <a name="l00313"></a>00313                  
    221 <a name="l00314"></a>00314                 <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; i &lt; len; i++ )  
    222 <a name="l00315"></a>00315                         from_setting( array_to_load(i), link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>[i] );  
    223 <a name="l00316"></a>00316         } 
    224 <a name="l00317"></a>00317  
    225 <a name="l00318"></a>00318 <span class="keyword">protected</span>: 
    226 <a name="l00320"></a><a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8">00320</a>         <a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8" title="Default constructor for internal use only, see.">UI</a>( <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; class_name, <span class="keyword">const</span> type_info * <span class="keyword">const</span> class_type_info )  
    227 <a name="l00321"></a>00321         {        
    228 <a name="l00322"></a>00322                 MappedUI::add_class( class_name, class_type_info, <span class="keyword">this</span> ); 
     166<a name="l00250"></a>00250                 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; retrieve_class_name ( <span class="keyword">const</span> type_info* <span class="keyword">const</span> class_type_info ); 
     167<a name="l00251"></a>00251         }; 
     168<a name="l00252"></a>00252  
     169<a name="l00254"></a>00254         <span class="keyword">static</span> <span class="keywordtype">void</span> assert_type ( <span class="keyword">const</span> Setting &amp;element, Setting::Type type ); 
     170<a name="l00255"></a>00255  
     171<a name="l00264"></a>00264         <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1root.html" title="Root class of BDM objects.">root</a>* new_instance() <span class="keyword">const</span> = 0; 
     172<a name="l00265"></a>00265  
     173<a name="l00267"></a>00267         <span class="keyword">static</span> <span class="keyword">const</span> Setting&amp; to_child_setting ( <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ); 
     174<a name="l00268"></a>00268  
     175<a name="l00270"></a>00270         <span class="keyword">static</span> <span class="keyword">const</span> Setting&amp; to_child_setting ( <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name ); 
     176<a name="l00271"></a>00271  
     177<a name="l00273"></a>00273         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting ( mat&amp; matrix, <span class="keyword">const</span> Setting &amp;element ); 
     178<a name="l00275"></a>00275         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting ( ivec &amp;vector, <span class="keyword">const</span> Setting &amp;element ); 
     179<a name="l00277"></a>00277         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting ( <span class="keywordtype">string</span> &amp;<a class="code" href="classbdm_1_1str.html" title="Structure of RV, i.e. RVs expanded into a flat list of IDs, used for debugging.">str</a>, <span class="keyword">const</span> Setting &amp;element ); 
     180<a name="l00279"></a>00279         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting ( vec &amp;vector, <span class="keyword">const</span> Setting &amp;element ); 
     181<a name="l00281"></a>00281         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting ( <span class="keywordtype">int</span> &amp;integer, <span class="keyword">const</span> Setting &amp;element ); 
     182<a name="l00283"></a>00283         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting ( <span class="keywordtype">double</span> &amp;real, <span class="keyword">const</span> Setting &amp;element ); 
     183<a name="l00284"></a>00284  
     184<a name="l00286"></a>00286         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting ( T* &amp;instance, <span class="keyword">const</span> Setting &amp;element ) { 
     185<a name="l00287"></a>00287                 <span class="keyword">const</span> <a class="code" href="classbdm_1_1SettingResolver.html" title="This class serves to expand links used within configuration files.">SettingResolver</a> link ( element ); 
     186<a name="l00288"></a>00288                 assert_type ( link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>, Setting::TypeGroup ); 
     187<a name="l00289"></a>00289  
     188<a name="l00290"></a>00290                 <span class="comment">// we get a value stored in the "class" attribute</span> 
     189<a name="l00291"></a>00291                 <span class="keywordtype">string</span> class_name; 
     190<a name="l00292"></a>00292                 <span class="keywordflow">if</span> ( !link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>.lookupValue ( <span class="stringliteral">"class"</span>, class_name ) ) 
     191<a name="l00293"></a>00293                         <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html">UIException</a> ( <span class="stringliteral">"the obligatory \"class\" identifier is missing"</span>, link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a> ); 
     192<a name="l00294"></a>00294  
     193<a name="l00295"></a>00295                 <span class="comment">// then we find a user-info related to this type</span> 
     194<a name="l00296"></a>00296                 <span class="keyword">const</span> <a class="code" href="classbdm_1_1UI.html" title="UI is an abstract class which collects all the auxiliary functions useful to prepare...">UI</a>&amp; related_UI = MappedUI::retrieve_ui ( class_name ); 
     195<a name="l00297"></a>00297  
     196<a name="l00298"></a>00298                 <a class="code" href="classbdm_1_1root.html" title="Root class of BDM objects.">root</a> *typeless_instance = related_UI.<a class="code" href="classbdm_1_1UI.html#77291f28a4b951522ae5f6a03121b635" title="Method constructing a configured instance.">new_instance</a>(); 
     197<a name="l00299"></a>00299                 it_assert_debug ( typeless_instance, <span class="stringliteral">"UI::new_instance failed"</span> ); 
     198<a name="l00300"></a>00300  
     199<a name="l00301"></a>00301                 instance = <span class="keyword">dynamic_cast&lt;</span>T*<span class="keyword">&gt;</span> ( typeless_instance ); 
     200<a name="l00302"></a>00302                 <span class="keywordflow">if</span> ( !instance ) { 
     201<a name="l00303"></a>00303                         <span class="keyword">delete</span> typeless_instance; 
     202<a name="l00304"></a>00304                         <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html">UIException</a> ( <span class="stringliteral">"class "</span> + class_name + <span class="stringliteral">" is not a descendant of the desired output class. Try to call the UI::build&lt;T&gt; function with a different type parameter."</span>, link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a> ); 
     203<a name="l00305"></a>00305                 } 
     204<a name="l00306"></a>00306  
     205<a name="l00307"></a>00307                 <span class="keywordflow">try</span> { 
     206<a name="l00308"></a>00308                         instance-&gt;from_setting ( link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a> ); 
     207<a name="l00309"></a>00309                 } <span class="keywordflow">catch</span> ( SettingException sttng_xcptn ) { 
     208<a name="l00310"></a>00310                         <span class="keywordtype">string</span> msg = <span class="stringliteral">"the method "</span> + class_name + <span class="stringliteral">".from_setting(Setting&amp;) has thrown a SettingException. Try to correct this method. Check path \""</span> + sttng_xcptn.getPath() + <span class="stringliteral">"\"."</span>; 
     209<a name="l00311"></a>00311                         <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html">UIException</a>(msg, link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>); 
     210<a name="l00312"></a>00312                 } 
     211<a name="l00313"></a>00313         } 
     212<a name="l00314"></a>00314  
     213<a name="l00317"></a>00317         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; 
     214<a name="l00318"></a>00318         <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting ( <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;T&gt;</a> &amp;instance, <span class="keyword">const</span> Setting &amp;element ) { 
     215<a name="l00319"></a>00319                 T *tmp_inst = 0; 
     216<a name="l00320"></a>00320                 from_setting ( tmp_inst, element ); 
     217<a name="l00321"></a>00321                 it_assert_debug ( tmp_inst, <span class="stringliteral">"UI::from_setting failed"</span> ); 
     218<a name="l00322"></a>00322                 instance = tmp_inst; 
    229219<a name="l00323"></a>00323         } 
    230220<a name="l00324"></a>00324  
    231 <a name="l00325"></a>00325 <span class="keyword">public</span>:  
    232 <a name="l00326"></a>00326  
     221<a name="l00326"></a>00326         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting ( Array&lt;T&gt; &amp;array_to_load, <span class="keyword">const</span> Setting &amp;element ) { 
     222<a name="l00327"></a>00327                 <span class="keyword">const</span> <a class="code" href="classbdm_1_1SettingResolver.html" title="This class serves to expand links used within configuration files.">SettingResolver</a> link ( element ); 
     223<a name="l00328"></a>00328  
     224<a name="l00329"></a>00329                 assert_type ( link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>, Setting::TypeList ); 
    233225<a name="l00330"></a>00330  
    234 <a name="l00332"></a><a class="code" href="classbdm_1_1UI.html#dda27449f8bd19d54db9ccfb2644e908">00332</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> T* <a class="code" href="classbdm_1_1UI.html#dda27449f8bd19d54db9ccfb2644e908" title="The new instance of type T* is constructed and initialized with values stored in...">build</a>( <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name ) 
    235 <a name="l00333"></a>00333         {                        
    236 <a name="l00334"></a>00334                 T* instance; 
    237 <a name="l00335"></a>00335                 from_setting&lt;T&gt;( instance, to_child_setting( element, name ) ); 
    238 <a name="l00336"></a>00336                 <span class="keywordflow">return</span> instance; 
     226<a name="l00331"></a>00331                 <span class="keywordtype">int</span> len = link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>.getLength(); 
     227<a name="l00332"></a>00332                 array_to_load.set_length ( len ); 
     228<a name="l00333"></a>00333                 <span class="keywordflow">if</span> ( len == 0 ) <span class="keywordflow">return</span>; 
     229<a name="l00334"></a>00334  
     230<a name="l00335"></a>00335                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; len; i++ ) 
     231<a name="l00336"></a>00336                         from_setting ( array_to_load ( i ), link.<a class="code" href="classbdm_1_1SettingResolver.html#adfcd0a81d025c52c8335b6aea07b498" title="Reference to a resolved link or to the original Setting in the case it does not contain...">result</a>[i] ); 
    239232<a name="l00337"></a>00337         } 
    240 <a name="l00339"></a><a class="code" href="classbdm_1_1UI.html#f0eccc7bbe4b680f3e1cb84b455a1125">00339</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> T* <a class="code" href="classbdm_1_1UI.html#dda27449f8bd19d54db9ccfb2644e908" title="The new instance of type T* is constructed and initialized with values stored in...">build</a>( <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ) 
    241 <a name="l00340"></a>00340         { 
    242 <a name="l00341"></a>00341                 T* instance; 
    243 <a name="l00342"></a>00342                 from_setting&lt;T&gt;( instance, to_child_setting( element, index ) ); 
    244 <a name="l00343"></a>00343                 <span class="keywordflow">return</span> instance; 
    245 <a name="l00344"></a>00344         } 
    246 <a name="l00346"></a><a class="code" href="classbdm_1_1UI.html#6e2da6a142fecf5f21e0bb86a7211cb4">00346</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> T* <a class="code" href="classbdm_1_1UI.html#dda27449f8bd19d54db9ccfb2644e908" title="The new instance of type T* is constructed and initialized with values stored in...">build</a>( <span class="keyword">const</span> Setting &amp;element ) 
    247 <a name="l00347"></a>00347         { 
    248 <a name="l00348"></a>00348                 T* instance; 
    249 <a name="l00349"></a>00349                 from_setting&lt;T&gt;( instance,  element ); 
    250 <a name="l00350"></a>00350                 <span class="keywordflow">return</span> instance; 
    251 <a name="l00351"></a>00351         } 
    252 <a name="l00353"></a>00353  
     233<a name="l00338"></a>00338  
     234<a name="l00343"></a>00343         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> from_setting ( T &amp;variable_to_load, <span class="keyword">const</span> Setting &amp;element ) { 
     235<a name="l00344"></a>00344                 std::string msg = <span class="stringliteral">"from_setting is not implemented for type "</span>; 
     236<a name="l00345"></a>00345                 msg += <span class="keyword">typeid</span>(T).name(); 
     237<a name="l00346"></a>00346                 <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html">UIException</a> ( msg, element ); 
     238<a name="l00347"></a>00347         } 
     239<a name="l00348"></a>00348  
     240<a name="l00349"></a>00349  
     241<a name="l00350"></a>00350 <span class="keyword">protected</span>: 
     242<a name="l00352"></a><a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8">00352</a>         <a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8" title="Constructor for internal use only, see.">UI</a> ( <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; class_name, <span class="keyword">const</span> type_info * <span class="keyword">const</span> class_type_info ) { 
     243<a name="l00353"></a>00353                 MappedUI::add_class ( class_name, class_type_info, <span class="keyword">this</span> ); 
     244<a name="l00354"></a>00354         } 
     245<a name="l00355"></a>00355  
     246<a name="l00356"></a>00356 <span class="keyword">public</span>: 
    253247<a name="l00357"></a>00357  
    254 <a name="l00359"></a><a class="code" href="classbdm_1_1UI.html#652bfd23f5052e4f1cb317057d74a3e2">00359</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( T &amp;instance, <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name ) 
    255 <a name="l00360"></a>00360         { 
    256 <a name="l00361"></a>00361                 from_setting( instance, to_child_setting( element, name ) ); 
    257 <a name="l00362"></a>00362         } 
    258 <a name="l00363"></a>00363  
    259 <a name="l00365"></a><a class="code" href="classbdm_1_1UI.html#3d04bb3d7dbcf0da0b4d5d3d5b7df51a">00365</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( T &amp;instance, <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ) 
    260 <a name="l00366"></a>00366         { 
    261 <a name="l00367"></a>00367                 from_setting( instance, to_child_setting( element, index ) ); 
    262 <a name="l00368"></a>00368         } 
    263 <a name="l00369"></a>00369  
    264 <a name="l00371"></a><a class="code" href="classbdm_1_1UI.html#25747ac6d0232aa7102dbb316f65ddce">00371</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( T &amp;instance, <span class="keyword">const</span> Setting &amp;element  ) 
    265 <a name="l00372"></a>00372         { 
    266 <a name="l00373"></a>00373                 from_setting( instance, element ); 
    267 <a name="l00374"></a>00374         } 
     248<a name="l00359"></a><a class="code" href="classbdm_1_1UI.html#88d02c1ffe93033af0f146e8008ab6e6">00359</a>         <span class="keyword">enum</span> <a class="code" href="classbdm_1_1UI.html#88d02c1ffe93033af0f146e8008ab6e6" title="Enum type used to determine whether the data for concrete Settingis is compulsory...">SettingPresence</a> { optional, compulsory } ; 
     249<a name="l00360"></a>00360  
     250<a name="l00364"></a>00364  
     251<a name="l00368"></a>00368         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; 
     252<a name="l00369"></a><a class="code" href="classbdm_1_1UI.html#1f3d45184f803e1256cfc896b43ed2f8">00369</a>         <span class="keyword">static</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;T&gt;</a> <a class="code" href="classbdm_1_1UI.html#1f3d45184f803e1256cfc896b43ed2f8">build</a> ( <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name, <a class="code" href="classbdm_1_1UI.html#88d02c1ffe93033af0f146e8008ab6e6" title="Enum type used to determine whether the data for concrete Settingis is compulsory...">SettingPresence</a> settingPresence = optional ) { 
     253<a name="l00370"></a>00370                 <span class="keywordflow">if</span> ( !element.exists ( name ) ) { 
     254<a name="l00371"></a>00371                         <span class="keywordflow">if</span> ( settingPresence == optional ) 
     255<a name="l00372"></a>00372                                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;T&gt;</a>(); 
     256<a name="l00373"></a>00373                         <span class="keywordflow">else</span> 
     257<a name="l00374"></a>00374                                 <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html">UIException</a> ( <span class="stringliteral">"the compulsory Setting named \""</span> + name + <span class="stringliteral">"\" is missing"</span>, element ); 
     258<a name="l00375"></a>00375                 } 
    268259<a name="l00376"></a>00376  
    269 <a name="l00380"></a>00380  
    270 <a name="l00382"></a><a class="code" href="classbdm_1_1UI.html#00bb5f2a328d272b0a3ffbda1a902d54">00382</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( Array&lt;T&gt; &amp;array_to_load, <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name ) 
    271 <a name="l00383"></a>00383         { 
    272 <a name="l00384"></a>00384                 from_setting( array_to_load, to_child_setting( element, name ) ); 
    273 <a name="l00385"></a>00385         } 
    274 <a name="l00386"></a>00386  
    275 <a name="l00388"></a><a class="code" href="classbdm_1_1UI.html#b6a224b6aea027e167d3d565b39144e0">00388</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( Array&lt;T&gt; &amp;array_to_load, <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">int</span> index ) 
    276 <a name="l00389"></a>00389         { 
    277 <a name="l00390"></a>00390                 from_setting( array_to_load, to_child_setting( element, index ) ); 
    278 <a name="l00391"></a>00391         } 
    279 <a name="l00392"></a>00392  
    280 <a name="l00394"></a><a class="code" href="classbdm_1_1UI.html#4fc5efdc58e4e184218b6d5beeb5ceab">00394</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">get</span>( Array&lt;T&gt; &amp;array_to_load, <span class="keyword">const</span> Setting &amp;element  ) 
    281 <a name="l00395"></a>00395         { 
    282 <a name="l00396"></a>00396                 from_setting( array_to_load, element ); 
    283 <a name="l00397"></a>00397         } 
    284 <a name="l00399"></a>00399  
    285 <a name="l00404"></a>00404  
    286 <a name="l00406"></a><a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917">00406</a>         <span class="keyword">template</span>&lt; <span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a>( <span class="keyword">const</span> T * <span class="keyword">const</span> instance, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span>) 
    287 <a name="l00407"></a>00407         { 
    288 <a name="l00408"></a>00408                 Setting &amp;<span class="keyword">set</span> = (name == <span class="stringliteral">""</span>) ? element.add( Setting::TypeGroup )                                                  
    289 <a name="l00409"></a>00409                                                                          : element.add( name, Setting::TypeGroup );              
    290 <a name="l00410"></a>00410  
    291 <a name="l00411"></a>00411                 <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;class_name = MappedUI::retrieve_class_name( &amp;<span class="keyword">typeid</span>(*instance) ); 
    292 <a name="l00412"></a>00412                          
    293 <a name="l00413"></a>00413                 <span class="comment">// add attribute "class" </span> 
    294 <a name="l00414"></a>00414                 Setting &amp;type = <span class="keyword">set</span>.add( <span class="stringliteral">"class"</span>, Setting::TypeString ); 
    295 <a name="l00415"></a>00415                 type = class_name; 
    296 <a name="l00416"></a>00416  
    297 <a name="l00417"></a>00417                 <span class="keywordflow">try</span> 
    298 <a name="l00418"></a>00418                 { 
    299 <a name="l00419"></a>00419                         instance-&gt;to_setting( <span class="keyword">set</span> ); 
    300 <a name="l00420"></a>00420                 } 
    301 <a name="l00421"></a>00421                 <span class="keywordflow">catch</span>(SettingException xcptn) 
    302 <a name="l00422"></a>00422                 { 
    303 <a name="l00423"></a>00423                         <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html" title="Exception prepared for reporting user-info errors which are always related to some...">UIException</a>( <span class="stringliteral">"the method "</span> + class_name + <span class="stringliteral">".to_setting(Setting&amp;) has thrown an SettingException. Try to correct this method"</span>, xcptn.getPath()); 
    304 <a name="l00424"></a>00424                 }        
    305 <a name="l00425"></a>00425         } 
    306 <a name="l00426"></a>00426  
    307 <a name="l00428"></a><a class="code" href="classbdm_1_1UI.html#4514f93573a9d9126c506d176fbd3163">00428</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a>( <span class="keyword">const</span> Array&lt;T&gt; &amp;array_to_save, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ) 
    308 <a name="l00429"></a>00429         { 
    309 <a name="l00430"></a>00430                 assert_type(element,Setting::TypeGroup); 
    310 <a name="l00431"></a>00431                 Setting &amp;list = (name == <span class="stringliteral">""</span>) ? element.add( Setting::TypeList )                                                  
    311 <a name="l00432"></a>00432                                                                          : element.add( name, Setting::TypeList );               
    312 <a name="l00433"></a>00433                 <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; i&lt;array_to_save.length(); i++ )  
    313 <a name="l00434"></a>00434                         <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a>( array_to_save(i), list ); 
    314 <a name="l00435"></a>00435         } 
    315 <a name="l00436"></a>00436  
    316 <a name="l00438"></a>00438         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a>( <span class="keyword">const</span> mat &amp;matrix, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
    317 <a name="l00439"></a>00439  
    318 <a name="l00441"></a>00441         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a>( <span class="keyword">const</span> ivec &amp;vec, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
    319 <a name="l00442"></a>00442          
    320 <a name="l00444"></a>00444         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a>( <span class="keyword">const</span> vec &amp;vector, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
     260<a name="l00377"></a>00377                 <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;T&gt;</a> instance; 
     261<a name="l00378"></a>00378                 from_setting&lt;T&gt; ( instance, to_child_setting ( element, name ) ); 
     262<a name="l00379"></a>00379                 <span class="keywordflow">return</span> instance; 
     263<a name="l00380"></a>00380         } 
     264<a name="l00381"></a>00381  
     265<a name="l00385"></a>00385         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; 
     266<a name="l00386"></a><a class="code" href="classbdm_1_1UI.html#f02851b299aedeb891e30c4807903081">00386</a>         <span class="keyword">static</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;T&gt;</a> <a class="code" href="classbdm_1_1UI.html#f02851b299aedeb891e30c4807903081">build</a> ( <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">int</span> index, <a class="code" href="classbdm_1_1UI.html#88d02c1ffe93033af0f146e8008ab6e6" title="Enum type used to determine whether the data for concrete Settingis is compulsory...">SettingPresence</a> settingPresence = optional ) { 
     267<a name="l00387"></a>00387                 <span class="keywordflow">if</span> ( element.getLength() &lt;= index ) { 
     268<a name="l00388"></a>00388                         <span class="keywordflow">if</span> ( settingPresence == optional ) 
     269<a name="l00389"></a>00389                                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;T&gt;</a>(); 
     270<a name="l00390"></a>00390                         <span class="keywordflow">else</span> { 
     271<a name="l00391"></a>00391                                 stringstream stream; 
     272<a name="l00392"></a>00392                                 stream &lt;&lt; index; 
     273<a name="l00393"></a>00393                                 <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html">UIException</a> ( <span class="stringliteral">"the compulsory Setting with the index "</span> + stream.str() + <span class="stringliteral">" is missing"</span>, element ); 
     274<a name="l00394"></a>00394                         } 
     275<a name="l00395"></a>00395                 } 
     276<a name="l00396"></a>00396  
     277<a name="l00397"></a>00397                 <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;T&gt;</a> instance; 
     278<a name="l00398"></a>00398                 from_setting&lt;T&gt; ( instance, to_child_setting ( element, index ) ); 
     279<a name="l00399"></a>00399                 <span class="keywordflow">return</span> instance; 
     280<a name="l00400"></a>00400         } 
     281<a name="l00401"></a>00401  
     282<a name="l00403"></a>00403  
     283<a name="l00407"></a>00407  
     284<a name="l00410"></a><a class="code" href="classbdm_1_1UI.html#cd1667e6fec99ec64dabcb3ca2ff922d">00410</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">bool</span> <span class="keyword">get</span> ( T &amp;instance, <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name, <a class="code" href="classbdm_1_1UI.html#88d02c1ffe93033af0f146e8008ab6e6" title="Enum type used to determine whether the data for concrete Settingis is compulsory...">SettingPresence</a> settingPresence = optional ) { 
     285<a name="l00411"></a>00411                 <span class="keywordflow">if</span> ( !element.exists ( name ) ) { 
     286<a name="l00412"></a>00412                         <span class="keywordflow">if</span> ( settingPresence == optional ) 
     287<a name="l00413"></a>00413                                 <span class="keywordflow">return</span> <span class="keyword">false</span>; 
     288<a name="l00414"></a>00414                         <span class="keywordflow">else</span> 
     289<a name="l00415"></a>00415                                 <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html">UIException</a> ( <span class="stringliteral">"the compulsory Setting named \""</span> + name + <span class="stringliteral">"\" is missing"</span>, element ); 
     290<a name="l00416"></a>00416                 } 
     291<a name="l00417"></a>00417  
     292<a name="l00418"></a>00418                 from_setting ( instance, to_child_setting ( element, name ) ); 
     293<a name="l00419"></a>00419                 <span class="keywordflow">return</span> <span class="keyword">true</span>; 
     294<a name="l00420"></a>00420         } 
     295<a name="l00421"></a>00421  
     296<a name="l00424"></a><a class="code" href="classbdm_1_1UI.html#6fb95ccb13515a3f23080a397dacaa0e">00424</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">bool</span> <span class="keyword">get</span> ( T &amp;instance, <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">int</span> index, <a class="code" href="classbdm_1_1UI.html#88d02c1ffe93033af0f146e8008ab6e6" title="Enum type used to determine whether the data for concrete Settingis is compulsory...">SettingPresence</a> settingPresence = optional ) { 
     297<a name="l00425"></a>00425                 <span class="keywordflow">if</span> ( element.getLength() &lt;= index ) { 
     298<a name="l00426"></a>00426                         <span class="keywordflow">if</span> ( settingPresence == optional ) 
     299<a name="l00427"></a>00427                                 <span class="keywordflow">return</span> <span class="keyword">false</span>; 
     300<a name="l00428"></a>00428                         <span class="keywordflow">else</span> { 
     301<a name="l00429"></a>00429                                 stringstream stream; 
     302<a name="l00430"></a>00430                                 stream &lt;&lt; index; 
     303<a name="l00431"></a>00431                                 <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html">UIException</a> ( <span class="stringliteral">"the compulsory Setting with the index "</span> + stream.str() + <span class="stringliteral">" is missing"</span>, element ); 
     304<a name="l00432"></a>00432                         } 
     305<a name="l00433"></a>00433                 } 
     306<a name="l00434"></a>00434  
     307<a name="l00435"></a>00435                 from_setting ( instance, to_child_setting ( element, index ) ); 
     308<a name="l00436"></a>00436                 <span class="keywordflow">return</span> <span class="keyword">true</span>; 
     309<a name="l00437"></a>00437         } 
     310<a name="l00438"></a>00438  
     311<a name="l00440"></a><a class="code" href="classbdm_1_1UI.html#7d2ea138c7285565507fa61fbd9b038f">00440</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">bool</span> <span class="keyword">get</span> ( T &amp;instance, <span class="keyword">const</span> Setting &amp;element ) { 
     312<a name="l00441"></a>00441                 from_setting ( instance, element ); 
     313<a name="l00442"></a>00442                 <span class="keywordflow">return</span> <span class="keyword">true</span>; 
     314<a name="l00443"></a>00443         } 
    321315<a name="l00445"></a>00445  
    322 <a name="l00447"></a>00447         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;str, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
    323 <a name="l00448"></a>00448  
    324 <a name="l00450"></a>00450         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a>( <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;integer, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
    325 <a name="l00451"></a>00451  
    326 <a name="l00453"></a>00453         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a>( <span class="keyword">const</span> <span class="keywordtype">double</span> &amp;real, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> );       
     316<a name="l00449"></a>00449  
     317<a name="l00452"></a><a class="code" href="classbdm_1_1UI.html#81ce18ed0bb9993a634db2b99612ad66">00452</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">bool</span> <span class="keyword">get</span> ( Array&lt;T&gt; &amp;array_to_load, <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name, <a class="code" href="classbdm_1_1UI.html#88d02c1ffe93033af0f146e8008ab6e6" title="Enum type used to determine whether the data for concrete Settingis is compulsory...">SettingPresence</a> settingPresence = optional ) { 
     318<a name="l00453"></a>00453                 <span class="keywordflow">if</span> ( !element.exists ( name ) ) 
     319<a name="l00454"></a>00454                         <span class="keywordflow">return</span> <span class="keyword">false</span>; 
    327320<a name="l00455"></a>00455  
    328 <a name="l00456"></a>00456 }; 
    329 <a name="l00457"></a>00457  
    330 <a name="l00458"></a>00458  
    331 <a name="l00460"></a><a class="code" href="classbdm_1_1ParticularUI.html">00460</a> <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt; <span class="keyword">class </span><a class="code" href="classbdm_1_1ParticularUI.html" title="The only UI descendant class which is not intended for direct use. It should be accessed...">ParticularUI</a> : <span class="keyword">private</span> <a class="code" href="classbdm_1_1UI.html" title="UI is an abstract class and it is intended for internal purposes only.">UI</a> 
    332 <a name="l00461"></a>00461 { 
    333 <a name="l00462"></a>00462 <span class="keyword">private</span>: 
    334 <a name="l00464"></a>00464         <a class="code" href="classbdm_1_1ParticularUI.html" title="The only UI descendant class which is not intended for direct use. It should be accessed...">ParticularUI&lt;T&gt;</a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;class_name) : <a class="code" href="classbdm_1_1UI.html#d60234c0673f345424329894b9b0cef8" title="Default constructor for internal use only, see.">UI</a>( class_name, &amp;<span class="keyword">typeid</span>(T) )  
    335 <a name="l00465"></a><a class="code" href="classbdm_1_1ParticularUI.html#18a208b7549160ae6aeb884dc2bcd90f">00465</a>         {}; 
    336 <a name="l00466"></a>00466  
    337 <a name="l00467"></a>00467 <span class="keyword">public</span>: 
    338 <a name="l00469"></a>00469         <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classbdm_1_1ParticularUI.html" title="The only UI descendant class which is not intended for direct use. It should be accessed...">ParticularUI&lt;T&gt;</a>&amp; <a class="code" href="classbdm_1_1ParticularUI.html#18a208b7549160ae6aeb884dc2bcd90f" title="The only instance of this class (each type T has its own instance) which is used...">factory</a>;   
    339 <a name="l00470"></a>00470  
    340 <a name="l00472"></a><a class="code" href="classbdm_1_1ParticularUI.html#a14fea8c7372a3d0a736e4ed0b617702">00472</a>         <a class="code" href="classbdm_1_1root.html" title="Root class of BDM objects.">root</a>* <a class="code" href="classbdm_1_1ParticularUI.html#a14fea8c7372a3d0a736e4ed0b617702" title="A method returning a brand new instance of class T, this method is the reason why...">new_instance</a>()<span class="keyword"> const</span> 
    341 <a name="l00473"></a>00473 <span class="keyword">        </span>{ 
    342 <a name="l00474"></a>00474                 <span class="keywordflow">return</span> <span class="keyword">new</span> T(); 
    343 <a name="l00475"></a>00475         } 
    344 <a name="l00476"></a>00476 }; 
    345 <a name="l00477"></a>00477  
    346 <a name="l00478"></a>00478 } 
    347 <a name="l00479"></a>00479  
    348 <a name="l00480"></a>00480 <span class="preprocessor">#endif // #ifndef USER_INFO_H</span> 
     321<a name="l00456"></a>00456                 from_setting ( array_to_load, to_child_setting ( element, name ) ); 
     322<a name="l00457"></a>00457                 <span class="keywordflow">return</span> <span class="keyword">true</span>; 
     323<a name="l00458"></a>00458         } 
     324<a name="l00459"></a>00459  
     325<a name="l00462"></a><a class="code" href="classbdm_1_1UI.html#29e450ed5560f81ef2f845e7b1021b71">00462</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">bool</span> <span class="keyword">get</span> ( Array&lt;T&gt; &amp;array_to_load, <span class="keyword">const</span> Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">int</span> index, <a class="code" href="classbdm_1_1UI.html#88d02c1ffe93033af0f146e8008ab6e6" title="Enum type used to determine whether the data for concrete Settingis is compulsory...">SettingPresence</a> settingPresence = optional ) { 
     326<a name="l00463"></a>00463                 <span class="keywordflow">if</span> ( element.getLength() &lt;= index ) 
     327<a name="l00464"></a>00464                         <span class="keywordflow">return</span> <span class="keyword">false</span>; 
     328<a name="l00465"></a>00465  
     329<a name="l00466"></a>00466                 from_setting ( array_to_load, to_child_setting ( element, index ) ); 
     330<a name="l00467"></a>00467                 <span class="keywordflow">return</span> <span class="keyword">true</span>; 
     331<a name="l00468"></a>00468         } 
     332<a name="l00469"></a>00469  
     333<a name="l00471"></a><a class="code" href="classbdm_1_1UI.html#c9fad8376d2f0857e719511f92f93998">00471</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">bool</span> <span class="keyword">get</span> ( Array&lt;T&gt; &amp;array_to_load, <span class="keyword">const</span> Setting &amp;element ) { 
     334<a name="l00472"></a>00472                 from_setting ( array_to_load, element ); 
     335<a name="l00473"></a>00473                 <span class="keywordflow">return</span> <span class="keyword">true</span>; 
     336<a name="l00474"></a>00474         } 
     337<a name="l00476"></a>00476  
     338<a name="l00481"></a>00481  
     339<a name="l00483"></a><a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917">00483</a>         <span class="keyword">template</span>&lt; <span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a> ( <span class="keyword">const</span> T * <span class="keyword">const</span> instance, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ) { 
     340<a name="l00484"></a>00484                 Setting &amp;<span class="keyword">set</span> = ( name == <span class="stringliteral">""</span> ) ? element.add ( Setting::TypeGroup ) 
     341<a name="l00485"></a>00485                                : element.add ( name, Setting::TypeGroup ); 
     342<a name="l00486"></a>00486  
     343<a name="l00487"></a>00487                 <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;class_name = MappedUI::retrieve_class_name ( &amp;<span class="keyword">typeid</span> ( *instance ) ); 
     344<a name="l00488"></a>00488  
     345<a name="l00489"></a>00489                 <span class="comment">// add attribute "class"</span> 
     346<a name="l00490"></a>00490                 Setting &amp;type = <span class="keyword">set</span>.add ( <span class="stringliteral">"class"</span>, Setting::TypeString ); 
     347<a name="l00491"></a>00491                 type = class_name; 
     348<a name="l00492"></a>00492  
     349<a name="l00493"></a>00493                 <span class="keywordflow">try</span> { 
     350<a name="l00494"></a>00494                         instance-&gt;to_setting ( <span class="keyword">set</span> ); 
     351<a name="l00495"></a>00495                 } <span class="keywordflow">catch</span> ( SettingException sttng_xcptn ) { 
     352<a name="l00496"></a>00496                     <span class="keywordtype">string</span> msg = <span class="stringliteral">"the method "</span>; 
     353<a name="l00497"></a>00497                     msg += class_name; 
     354<a name="l00498"></a>00498                     msg += <span class="stringliteral">".to_setting(Setting&amp;) has thrown a SettingException. Try to correct this method."</span>; 
     355<a name="l00499"></a>00499                     <span class="keywordflow">throw</span> <a class="code" href="classbdm_1_1UIException.html">UIException</a>(msg, sttng_xcptn.getPath()); 
     356<a name="l00500"></a>00500                 } 
     357<a name="l00501"></a>00501         } 
     358<a name="l00502"></a>00502  
     359<a name="l00503"></a>00503         <span class="keyword">template</span>&lt; <span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;T&gt;</a> &amp;instance, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ) { 
     360<a name="l00504"></a>00504                 save&lt;T&gt; ( instance.<a class="code" href="classbdm_1_1shared__ptr.html#37ebcfb6750dd7b5630f1d2354c07a96">get</a>(), element, name ); 
     361<a name="l00505"></a>00505         } 
     362<a name="l00506"></a>00506  
     363<a name="l00508"></a><a class="code" href="classbdm_1_1UI.html#4514f93573a9d9126c506d176fbd3163">00508</a>         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#4514f93573a9d9126c506d176fbd3163" title="An Array&amp;lt;T&amp;gt; instance is stored in the new child Setting appended to the passed...">save</a> ( <span class="keyword">const</span> Array&lt;T&gt; &amp;array_to_save, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ) { 
     364<a name="l00509"></a>00509                 assert_type ( element, Setting::TypeGroup ); 
     365<a name="l00510"></a>00510                 Setting &amp;list = ( name == <span class="stringliteral">""</span> ) ? element.add ( Setting::TypeList ) 
     366<a name="l00511"></a>00511                                 : element.add ( name, Setting::TypeList ); 
     367<a name="l00512"></a>00512                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; array_to_save.length(); i++ ) 
     368<a name="l00513"></a>00513                         <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a> ( array_to_save ( i ), list ); 
     369<a name="l00514"></a>00514         } 
     370<a name="l00515"></a>00515  
     371<a name="l00517"></a>00517         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a> ( <span class="keyword">const</span> mat &amp;matrix, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
     372<a name="l00518"></a>00518  
     373<a name="l00520"></a>00520         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a> ( <span class="keyword">const</span> ivec &amp;vec, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
     374<a name="l00521"></a>00521  
     375<a name="l00523"></a>00523         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a> ( <span class="keyword">const</span> vec &amp;vector, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
     376<a name="l00524"></a>00524  
     377<a name="l00526"></a>00526         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a> ( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;str, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
     378<a name="l00527"></a>00527  
     379<a name="l00529"></a>00529         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a> ( <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;integer, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
     380<a name="l00530"></a>00530  
     381<a name="l00532"></a>00532         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1UI.html#c83987949e6a9e79d6e093797ab7d917" title="A root descendant instance is stored in the new child Setting appended to the passed...">save</a> ( <span class="keyword">const</span> <span class="keywordtype">double</span> &amp;real, Setting &amp;element, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name = <span class="stringliteral">""</span> ); 
     382<a name="l00534"></a>00534  
     383<a name="l00535"></a>00535 }; 
     384<a name="l00536"></a>00536  
     385<a name="l00537"></a>00537  
     386<a name="l00540"></a><a class="code" href="classbdm_1_1ParticularUI.html">00540</a> <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt; <span class="keyword">class </span><a class="code" href="classbdm_1_1ParticularUI.html">ParticularUI</a> : <span class="keyword">private</span> <a class="code" href="classbdm_1_1UI.html" title="UI is an abstract class which collects all the auxiliary functions useful to prepare...">UI</a> { 
     387<a name="l00541"></a>00541 <span class="keyword">public</span>: 
     388<a name="l00543"></a>00543         <a class="code" href="classbdm_1_1ParticularUI.html">ParticularUI&lt;T&gt;</a> ( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;class_name ) : <a class="code" href="classbdm_1_1UI.html" title="UI is an abstract class which collects all the auxiliary functions useful to prepare...">UI</a> ( class_name, &amp;<span class="keyword">typeid</span> ( T ) ) {}; 
     389<a name="l00544"></a>00544  
     390<a name="l00546"></a><a class="code" href="classbdm_1_1ParticularUI.html#a14fea8c7372a3d0a736e4ed0b617702">00546</a>         <a class="code" href="classbdm_1_1root.html" title="Root class of BDM objects.">root</a>* <a class="code" href="classbdm_1_1ParticularUI.html#a14fea8c7372a3d0a736e4ed0b617702" title="A method returning a brand new instance of class T, this method is the reason why...">new_instance</a>()<span class="keyword"> const </span>{ 
     391<a name="l00547"></a>00547                 <span class="keywordflow">return</span> <span class="keyword">new</span> T(); 
     392<a name="l00548"></a>00548         } 
     393<a name="l00549"></a>00549 }; 
     394<a name="l00550"></a>00550  
     395<a name="l00551"></a>00551 } 
     396<a name="l00552"></a>00552  
     397<a name="l00562"></a>00562 <span class="preprocessor">#ifndef BDMLIB</span> 
     398<a name="l00563"></a><a class="code" href="user__info_8h.html#4f9de2f17e844047726487b99def99c6">00563</a> <span class="preprocessor"></span><span class="preprocessor">#define UIREGISTER(class_name) static bdm::ParticularUI&lt;class_name&gt; UI##class_name(#class_name)</span> 
     399<a name="l00564"></a>00564 <span class="preprocessor"></span><span class="preprocessor">#else</span> 
     400<a name="l00565"></a>00565 <span class="preprocessor"></span><span class="preprocessor">#define UIREGISTER(class_name)</span> 
     401<a name="l00566"></a>00566 <span class="preprocessor"></span><span class="preprocessor">#endif</span> 
     402<a name="l00567"></a>00567 <span class="preprocessor"></span> 
     403<a name="l00569"></a><a class="code" href="user__info_8h.html#852592d44ce65a0a870c76b42155aaca">00569</a> <span class="preprocessor">#define QUOTEME(x) #x</span> 
     404<a name="l00570"></a>00570 <span class="preprocessor"></span> 
     405<a name="l00579"></a>00579 <span class="preprocessor">#ifndef BDMLIB</span> 
     406<a name="l00580"></a><a class="code" href="user__info_8h.html#b06f1e7c44a8306e321f62a0099210b9">00580</a> <span class="preprocessor"></span><span class="preprocessor">#define UIREGISTER2(class_name, temp_name) static bdm::ParticularUI&lt;class_name&lt;temp_name&gt; &gt; UI##class_name##_##temp_name( QUOTEME(class_name&lt;temp_name&gt;) )</span> 
     407<a name="l00581"></a>00581 <span class="preprocessor"></span><span class="preprocessor">#else</span> 
     408<a name="l00582"></a>00582 <span class="preprocessor"></span><span class="preprocessor">#define UIREGISTER2(class_name,temp_name) </span> 
     409<a name="l00583"></a>00583 <span class="preprocessor"></span><span class="preprocessor">#endif</span> 
     410<a name="l00584"></a>00584 <span class="preprocessor"></span> 
     411<a name="l00585"></a>00585 <span class="preprocessor">#endif // #ifndef USER_INFO_H</span> 
    349412</pre></div></div> 
    350 <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jul 1 13:05:56 2009 for mixpp by&nbsp; 
     413<hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 16 17:58:18 2009 for mixpp by&nbsp; 
    351414<a href="http://www.doxygen.org/index.html"> 
    352415<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>