root/doc/html/userinfo_8h-source.html @ 84

Revision 84, 19.4 kB (checked in by smidl, 16 years ago)

doxy

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3<title>mixpp: work/mixpp/bdm/userinfo.h Source File</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5<link href="tabs.css" rel="stylesheet" type="text/css">
6</head><body>
7<!-- Generated by Doxygen 1.5.3 -->
8<div class="tabs">
9  <ul>
10    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
11    <li><a href="annotated.html"><span>Classes</span></a></li>
12    <li class="current"><a href="files.html"><span>Files</span></a></li>
13    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
14  </ul>
15</div>
16<h1>work/mixpp/bdm/userinfo.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span>
17<a name="l00002"></a>00002 <span class="comment">// C++ Interface: userinfo</span>
18<a name="l00003"></a>00003 <span class="comment">//</span>
19<a name="l00004"></a>00004 <span class="comment">// Description:</span>
20<a name="l00005"></a>00005 <span class="comment">//</span>
21<a name="l00006"></a>00006 <span class="comment">//</span>
22<a name="l00007"></a>00007 <span class="comment">// Author: smidl &lt;smidl@utia.cas.cz&gt;, (C) 2008</span>
23<a name="l00008"></a>00008 <span class="comment">//</span>
24<a name="l00009"></a>00009 <span class="comment">// Copyright: See COPYING file that comes with this distribution</span>
25<a name="l00010"></a>00010 <span class="comment">//</span>
26<a name="l00011"></a>00011 <span class="comment">//</span>
27<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;itpp/itbase.h&gt;</span>
28<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;itpp/base/mat.h&gt;</span>
29<a name="l00014"></a>00014
30<a name="l00015"></a>00015 <span class="keyword">using</span> std::cout;
31<a name="l00016"></a>00016 <span class="keyword">using</span> std::endl;
32<a name="l00017"></a>00017
33<a name="l00023"></a><a class="code" href="classuibase.html">00023</a> <span class="keyword">class </span><a class="code" href="classuibase.html" title="User Info base class.">uibase</a> {
34<a name="l00024"></a>00024 <span class="keyword">protected</span>:
35<a name="l00025"></a>00025         std::string comment;
36<a name="l00026"></a>00026         std::string help;
37<a name="l00027"></a>00027         <a class="code" href="classuibase.html" title="User Info base class.">uibase</a>* parent;
38<a name="l00028"></a>00028
39<a name="l00029"></a>00029 <span class="keyword">public</span>:
40<a name="l00031"></a><a class="code" href="classuibase.html#dba7521fba00b699df6ac0f3925d337c">00031</a>         <a class="code" href="classuibase.html#dba7521fba00b699df6ac0f3925d337c" title="Default constructor.">uibase</a> ( std::string com = <span class="stringliteral">"Abstract class, please ignore!"</span>) :comment ( com ) {parent=NULL;}
41<a name="l00033"></a><a class="code" href="classuibase.html#0da068d9c5b6564922c96957c0b42e1e">00033</a>         <a class="code" href="classuibase.html#dba7521fba00b699df6ac0f3925d337c" title="Default constructor.">uibase</a> ( std::string com,<a class="code" href="classuibase.html" title="User Info base class.">uibase</a> *par ) :comment ( com ),parent ( par ) {}
42<a name="l00034"></a>00034
43<a name="l00036"></a><a class="code" href="classuibase.html#de805f1ce9c1b261dc47d57c506d36f1">00036</a>         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classuibase.html#de805f1ce9c1b261dc47d57c506d36f1" title="returns a summary of its contents (used in dialogs)">getsummary</a> ( std::string &amp;S ) {};
44<a name="l00037"></a>00037
45<a name="l00039"></a><a class="code" href="classuibase.html#d28232d94715c153afb9280a8a4552eb">00039</a>         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classuibase.html#d28232d94715c153afb9280a8a4552eb" title="interaction with the user">askuser</a>(){};
46<a name="l00040"></a>00040
47<a name="l00042"></a><a class="code" href="classuibase.html#e7403110752e92a31db563556124742e">00042</a>         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classuibase.html#e7403110752e92a31db563556124742e" title="test if the info is valid">isvalid</a>() {<span class="keywordflow">return</span> <span class="keyword">true</span>;}
48<a name="l00044"></a><a class="code" href="classuibase.html#1972e8d075e083e0f033ac2e4fee3a7a">00044</a>         <span class="keyword">virtual</span> <a class="code" href="classuibase.html#1972e8d075e083e0f033ac2e4fee3a7a" title="for future use">~uibase</a>(){};
49<a name="l00045"></a>00045 };
50<a name="l00046"></a>00046
51<a name="l00048"></a>00048 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
52<a name="l00049"></a><a class="code" href="classuiscalar.html">00049</a> <span class="keyword">class </span><a class="code" href="classuiscalar.html" title="User info for scalars.">uiscalar</a> : <span class="keyword">public</span> <a class="code" href="classuibase.html" title="User Info base class.">uibase</a> {
53<a name="l00050"></a>00050 <span class="keyword">protected</span>:
54<a name="l00051"></a>00051         T N;
55<a name="l00052"></a>00052 <span class="keyword">public</span>:
56<a name="l00054"></a><a class="code" href="classuiscalar.html#37245083193e37ecfe25680aec25265c">00054</a>         <a class="code" href="classuiscalar.html#37245083193e37ecfe25680aec25265c" title="Default constructor.">uiscalar</a> ( std::string com,<a class="code" href="classuibase.html" title="User Info base class.">uibase</a>* par ) :<a class="code" href="classuibase.html" title="User Info base class.">uibase</a> ( com,par ) {N=T ( 0 );};
57<a name="l00055"></a>00055         <a class="code" href="classuiscalar.html#37245083193e37ecfe25680aec25265c" title="Default constructor.">uiscalar</a> ( std::string com) :<a class="code" href="classuibase.html" title="User Info base class.">uibase</a> ( com ) {N=T ( 0 );};
58<a name="l00056"></a>00056
59<a name="l00057"></a><a class="code" href="classuiscalar.html#cc3639d49c2577e7c40ebaf48ced444f">00057</a>         <span class="keywordtype">void</span> <a class="code" href="classuiscalar.html#cc3639d49c2577e7c40ebaf48ced444f" title="returns a summary of its contents (used in dialogs)">getsummary</a> ( std::string &amp;S ) {S=<span class="stringliteral">"Scalar"</span>;};
60<a name="l00058"></a>00058
61<a name="l00059"></a><a class="code" href="classuiscalar.html#9a21e792b929d081c33321714fbfe94f">00059</a>         <span class="keywordtype">void</span> <a class="code" href="classuiscalar.html#9a21e792b929d081c33321714fbfe94f" title="interaction with the user">askuser</a> (){};
62<a name="l00060"></a>00060
63<a name="l00062"></a>00062 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T2&gt;
64<a name="l00063"></a>00063         <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os, const uiscalar&lt;T2&gt; &amp;ui );
65<a name="l00064"></a>00064
66<a name="l00066"></a>00066 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T2&gt;
67<a name="l00067"></a>00067         <span class="keyword">friend</span> std::istream &amp;<a class="code" href="classuiscalar.html#62f3fb91be0b99ce1d19c10d99390f7b" title="saving the info">operator&gt;&gt; </a>( std::istream &amp;is, <span class="keyword">const</span> <a class="code" href="classuiscalar.html" title="User info for scalars.">uiscalar&lt;T2&gt;</a> &amp;ui );
68<a name="l00068"></a>00068         ~<a class="code" href="classuiscalar.html" title="User info for scalars.">uiscalar</a>(){};
69<a name="l00069"></a>00069 };
70<a name="l00070"></a>00070
71<a name="l00072"></a><a class="code" href="classuistring.html">00072</a> <span class="keyword">class </span><a class="code" href="classuistring.html" title="User info for strings.">uistring</a> : <span class="keyword">public</span> <a class="code" href="classuibase.html" title="User Info base class.">uibase</a> {
72<a name="l00073"></a>00073 <span class="keyword">protected</span>:
73<a name="l00074"></a>00074         std::string S;
74<a name="l00075"></a>00075 <span class="keyword">public</span>:
75<a name="l00076"></a><a class="code" href="classuistring.html#e386e7738fec80d6ef80a14ac03e05e4">00076</a>         <span class="keywordtype">void</span> <a class="code" href="classuistring.html#e386e7738fec80d6ef80a14ac03e05e4" title="returns a summary of its contents (used in dialogs)">getsummary</a> ( std::string &amp;S ) {S=<span class="stringliteral">"String"</span>;};
76<a name="l00077"></a>00077
77<a name="l00079"></a><a class="code" href="classuistring.html#4d450ad4b3e6cddae9c2b4a3134690f4">00079</a>         <a class="code" href="classuistring.html#4d450ad4b3e6cddae9c2b4a3134690f4" title="Default constructor.">uistring</a> ( std::string com ) :<a class="code" href="classuibase.html" title="User Info base class.">uibase</a> ( com ) {}
78<a name="l00080"></a>00080         
79<a name="l00081"></a><a class="code" href="classuistring.html#cb9eb5da0ad7bcb09f0d59b037954eec">00081</a>         <span class="keywordtype">void</span> <a class="code" href="classuistring.html#cb9eb5da0ad7bcb09f0d59b037954eec" title="interaction with the user">askuser</a> (){};
80<a name="l00083"></a>00083         <span class="keyword">friend</span> std::ostream &amp;<a class="code" href="classuistring.html#3ba809f52c859b68a0d0f328526cd5e2" title="saving the info">operator&lt;&lt; </a>( std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classuistring.html" title="User info for strings.">uistring</a> &amp;ui );
81<a name="l00084"></a>00084
82<a name="l00086"></a>00086         <span class="keyword">friend</span> std::istream &amp;<a class="code" href="classuistring.html#33827f649e8c8cfbe3760ae512038379" title="saving the info">operator&gt;&gt; </a>( std::istream &amp;is, <span class="keyword">const</span> <a class="code" href="classuistring.html" title="User info for strings.">uistring</a> &amp;ui );
83<a name="l00087"></a>00087
84<a name="l00088"></a>00088         ~<a class="code" href="classuistring.html" title="User info for strings.">uistring</a>(){};
85<a name="l00089"></a>00089 };
86<a name="l00090"></a>00090
87<a name="l00092"></a>00092 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
88<a name="l00093"></a><a class="code" href="classuivector.html">00093</a> <span class="keyword">class </span><a class="code" href="classuivector.html" title="User info for vectors.">uivector</a> : <span class="keyword">public</span> <a class="code" href="classuibase.html" title="User Info base class.">uibase</a> {
89<a name="l00094"></a>00094 <span class="keyword">protected</span>:     
90<a name="l00095"></a>00095         itpp::Vec&lt;T&gt; V;
91<a name="l00096"></a>00096 <span class="keyword">public</span>:
92<a name="l00097"></a><a class="code" href="classuivector.html#5ccf01fcd3717975d3a330f03a2bc347">00097</a>         <span class="keywordtype">void</span> <a class="code" href="classuivector.html#5ccf01fcd3717975d3a330f03a2bc347" title="returns a summary of its contents (used in dialogs)">getsummary</a> ( std::string &amp;S ) { S=<span class="stringliteral">"Vector of length "</span>+ V.length();};
93<a name="l00098"></a>00098
94<a name="l00100"></a><a class="code" href="classuivector.html#5aa6ee62b6db41598a0117e27368df78">00100</a>         <a class="code" href="classuivector.html#5aa6ee62b6db41598a0117e27368df78" title="Default constructor.">uivector</a> ( std::string com ) :<a class="code" href="classuibase.html" title="User Info base class.">uibase</a> ( com ) {};
95<a name="l00101"></a>00101
96<a name="l00102"></a><a class="code" href="classuivector.html#46f823703a8de31ba14cbcc3406819db">00102</a>         <span class="keywordtype">void</span> <a class="code" href="classuivector.html#46f823703a8de31ba14cbcc3406819db" title="interaction with the user">askuser</a> (){};
97<a name="l00104"></a>00104 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T2&gt;
98<a name="l00105"></a>00105         <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os, const uivector&lt;T2&gt; &amp;ui );
99<a name="l00106"></a>00106
100<a name="l00108"></a>00108 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T2&gt;
101<a name="l00109"></a>00109         <span class="keyword">friend</span> std::istream &amp;<a class="code" href="classuivector.html#71336018baff6f0bde9ef9e158b78c07" title="saving the info">operator&gt;&gt; </a>( std::istream &amp;is, <span class="keyword">const</span> <a class="code" href="classuivector.html" title="User info for vectors.">uivector&lt;T2&gt;</a> &amp;ui );
102<a name="l00110"></a>00110
103<a name="l00111"></a>00111 };
104<a name="l00112"></a>00112
105<a name="l00114"></a>00114 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
106<a name="l00115"></a><a class="code" href="classuimatrix.html">00115</a> <span class="keyword">class </span><a class="code" href="classuimatrix.html" title="User info for matrices.">uimatrix</a> : <span class="keyword">public</span> <a class="code" href="classuibase.html" title="User Info base class.">uibase</a> {
107<a name="l00116"></a>00116         itpp::Mat&lt;T&gt; M;
108<a name="l00117"></a>00117         
109<a name="l00119"></a>00119         <a class="code" href="classuimatrix.html" title="User info for matrices.">uimatrix</a> ( std::string com ) :<a class="code" href="classuibase.html#dba7521fba00b699df6ac0f3925d337c" title="Default constructor.">uibase</a> ( com ) {}
110<a name="l00120"></a>00120
111<a name="l00121"></a>00121         <span class="keywordtype">void</span> getsummary ( std::string &amp;S ) {sprintf ( S,<span class="stringliteral">"Matrix %dx%d"</span>,M.rows(),M.cols() );};
112<a name="l00122"></a>00122
113<a name="l00123"></a>00123         <span class="keywordtype">void</span> askuser (){};
114<a name="l00125"></a>00125 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T2&gt;
115<a name="l00126"></a>00126         <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os, const uimatrix&lt;T2&gt; &amp;ui );
116<a name="l00127"></a>00127
117<a name="l00129"></a>00129 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T2&gt;
118<a name="l00130"></a>00130         <span class="keyword">friend</span> std::istream &amp;<a class="code" href="classuimatrix.html#8eeaed7e2386de8b547b65637ae56e8d" title="saving the info">operator&gt;&gt; </a>( std::istream &amp;is, <span class="keyword">const</span> <a class="code" href="classuimatrix.html" title="User info for matrices.">uimatrix&lt;T2&gt;</a> &amp;ui );
119<a name="l00131"></a>00131
120<a name="l00132"></a>00132 };
121<a name="l00133"></a>00133
122<a name="l00135"></a><a class="code" href="classuicompound.html">00135</a> <span class="keyword">class </span><a class="code" href="classuicompound.html" title="Compound user info.">uicompound</a>: <span class="keyword">public</span> <a class="code" href="classuibase.html" title="User Info base class.">uibase</a> {
123<a name="l00136"></a>00136 <span class="keyword">protected</span>:
124<a name="l00137"></a>00137         <a class="code" href="classuibase.html" title="User Info base class.">uibase</a>** elems;
125<a name="l00138"></a>00138 <span class="keyword">public</span>:
126<a name="l00140"></a><a class="code" href="classuicompound.html#181137b83f1fb99a5699aa91dd7e3039">00140</a>         <a class="code" href="classuicompound.html#181137b83f1fb99a5699aa91dd7e3039" title="Default constructor.">uicompound</a> ( <span class="keyword">const</span> <span class="keywordtype">int</span> n0 ) : elems(new <a class="code" href="classuibase.html" title="User Info base class.">uibase</a>*[n0]) {};
127<a name="l00141"></a>00141         ~<a class="code" href="classuicompound.html" title="Compound user info.">uicompound</a>(){<span class="keyword">delete</span> elems;}
128<a name="l00142"></a>00142 };
129<a name="l00143"></a>00143
130<a name="l00144"></a>00144 <span class="keyword">typedef</span> <a class="code" href="classuimatrix.html" title="User info for matrices.">uimatrix&lt;double&gt;</a> <a class="code" href="classuimatrix.html" title="User info for matrices.">uimat</a>;
131<a name="l00145"></a>00145 <span class="keyword">typedef</span> <a class="code" href="classuimatrix.html" title="User info for matrices.">uimatrix&lt;int&gt;</a> <a class="code" href="classuimatrix.html" title="User info for matrices.">uiimat</a>;
132<a name="l00146"></a>00146
133<a name="l00147"></a>00147 <span class="keyword">typedef</span> <a class="code" href="classuivector.html" title="User info for vectors.">uivector&lt;double&gt;</a> <a class="code" href="classuivector.html" title="User info for vectors.">uivec</a>;
134<a name="l00148"></a>00148 <span class="keyword">typedef</span> <a class="code" href="classuivector.html" title="User info for vectors.">uivector&lt;int&gt;</a> <a class="code" href="classuivector.html" title="User info for vectors.">uiivec</a>;
135<a name="l00149"></a>00149
136<a name="l00150"></a>00150
137<a name="l00151"></a>00151 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
138<a name="l00152"></a>00152 std::istream &amp;operator&gt;&gt; ( std::istream &amp;is, <span class="keyword">const</span> <a class="code" href="classuiscalar.html" title="User info for scalars.">uiscalar&lt;T&gt;</a> &amp;ui ) {is&gt;&gt;ui.<a class="code" href="classuiscalar.html#42d6a9f5bc37168a76e735d1254b97b8">N</a>;<span class="keywordflow">return</span> is;};
139<a name="l00153"></a>00153 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
140<a name="l00154"></a>00154 std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os, const uiscalar&lt;T&gt; &amp;ui ) {os&lt;&lt;ui.N;<span class="keywordflow">return</span> os;};
141<a name="l00155"></a>00155
142<a name="l00156"></a>00156 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
143<a name="l00157"></a>00157 std::istream &amp;operator&gt;&gt; ( std::istream &amp;is, <span class="keyword">const</span> <a class="code" href="classuivector.html" title="User info for vectors.">uivector&lt;T&gt;</a> &amp;ui ) {is&gt;&gt;ui.<a class="code" href="classuivector.html#47efd0dfdea8804638ef674644de4253">V</a>;<span class="keywordflow">return</span> is;};
144<a name="l00158"></a>00158
145<a name="l00159"></a>00159 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
146<a name="l00160"></a>00160 std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os, const uivector&lt;T&gt; &amp;ui ) {os&lt;&lt;ui.V; <span class="keywordflow">return</span> os;};
147<a name="l00161"></a>00161
148<a name="l00162"></a>00162 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
149<a name="l00163"></a>00163 std::istream &amp;operator&gt;&gt; ( std::istream &amp;is, <span class="keyword">const</span> <a class="code" href="classuimatrix.html" title="User info for matrices.">uimatrix&lt;T&gt;</a> &amp;ui ) {is&gt;&gt;ui.<a class="code" href="classuimatrix.html#fd0ae0b8efd7cda2fb043d9a2d67b9e9">M</a>;<span class="keywordflow">return</span> is;};
150<a name="l00164"></a>00164
151<a name="l00165"></a>00165 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
152<a name="l00166"></a>00166 std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os, const uimatrix&lt;T&gt; &amp;ui ) {os&lt;&lt;ui.M;<span class="keywordflow">return</span> os;};
153<a name="l00167"></a>00167
154</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Apr 18 11:15:15 2008 for mixpp by&nbsp;
155<a href="http://www.doxygen.org/index.html">
156<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
157</body>
158</html>
Note: See TracBrowser for help on using the browser.