git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@40 331e1502-861f-0410-8da2-ba01fb791d7f
149 lines
12 KiB
HTML
149 lines
12 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>EO: eoUpdater.h Source File</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.3.9.1 -->
|
|
<div class="qindex"> <form class="search" action="search.php" method="get">
|
|
<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
|
|
<div class="nav">
|
|
<a class="el" href="dir_000000.html">src</a> / <a class="el" href="dir_000011.html">utils</a></div>
|
|
<h1>eoUpdater.h</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
|
|
00002
|
|
00003 <span class="comment">//-----------------------------------------------------------------------------</span>
|
|
00004 <span class="comment">// eoUpdater.h</span>
|
|
00005 <span class="comment">// (c) Maarten Keijzer, Marc Schoenauer and GeNeura Team, 2000</span>
|
|
00006 <span class="comment">/*</span>
|
|
00007 <span class="comment"> This library is free software; you can redistribute it and/or</span>
|
|
00008 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
|
|
00009 <span class="comment"> License as published by the Free Software Foundation; either</span>
|
|
00010 <span class="comment"> version 2 of the License, or (at your option) any later version.</span>
|
|
00011 <span class="comment"></span>
|
|
00012 <span class="comment"> This library is distributed in the hope that it will be useful,</span>
|
|
00013 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
|
00014 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
|
|
00015 <span class="comment"> Lesser General Public License for more details.</span>
|
|
00016 <span class="comment"></span>
|
|
00017 <span class="comment"> You should have received a copy of the GNU Lesser General Public</span>
|
|
00018 <span class="comment"> License along with this library; if not, write to the Free Software</span>
|
|
00019 <span class="comment"> Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
|
|
00020 <span class="comment"></span>
|
|
00021 <span class="comment"> Contact: todos@geneura.ugr.es, http://geneura.ugr.es</span>
|
|
00022 <span class="comment"> Marc.Schoenauer@polytechnique.fr</span>
|
|
00023 <span class="comment"> mkeijzer@dhi.dk</span>
|
|
00024 <span class="comment"> */</span>
|
|
00025 <span class="comment">//-----------------------------------------------------------------------------</span>
|
|
00026
|
|
00027 <span class="preprocessor">#ifndef _eoUpdater_h</span>
|
|
00028 <span class="preprocessor"></span><span class="preprocessor">#define _eoUpdater_h</span>
|
|
00029 <span class="preprocessor"></span>
|
|
00030 <span class="preprocessor">#include <string></span>
|
|
00031 <span class="preprocessor">#include <eoFunctor.h></span>
|
|
00032 <span class="preprocessor">#include <utils/eoState.h></span>
|
|
00033 <span class="preprocessor">#include <utils/eoParam.h></span>
|
|
00034
|
|
<a name="l00039"></a><a class="code" href="classeo_updater.html">00039</a> <span class="keyword">class </span><a class="code" href="classeo_updater.html">eoUpdater</a> : <span class="keyword">public</span> <a class="code" href="classeo_f.html">eoF</a><void>
|
|
00040 {
|
|
00041 <span class="keyword">public</span>:
|
|
00042 <span class="keyword">virtual</span> <span class="keywordtype">void</span> lastCall() {}
|
|
00043 <span class="keyword">virtual</span> std::string className(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="stringliteral">"eoUpdater"</span>; }
|
|
00044 };
|
|
00045
|
|
00049 <span class="keyword">template</span> <<span class="keyword">class</span> T>
|
|
<a name="l00050"></a><a class="code" href="classeo_incrementor.html">00050</a> <span class="keyword">class </span><a class="code" href="classeo_incrementor.html">eoIncrementor</a> : <span class="keyword">public</span> <a class="code" href="classeo_updater.html">eoUpdater</a>
|
|
00051 {<span class="keyword">public</span> :
|
|
<a name="l00053"></a><a class="code" href="classeo_incrementor.html#a0">00053</a> <a class="code" href="classeo_incrementor.html#a0">eoIncrementor</a>(T& _counter, T _stepsize = 1) : counter(_counter), stepsize(_stepsize) {}
|
|
00054
|
|
<a name="l00056"></a><a class="code" href="classeo_incrementor.html#a1">00056</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classeo_incrementor.html#a1">operator()</a>()
|
|
00057 {
|
|
00058 counter += stepsize;
|
|
00059 }
|
|
00060
|
|
00061 <span class="keyword">virtual</span> std::string className(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="stringliteral">"eoIncrementor"</span>; }
|
|
00062 <span class="keyword">private</span>:
|
|
00063 T& counter;
|
|
00064 T stepsize;
|
|
00065 };
|
|
00066
|
|
00070 <span class="keyword">template</span> <<span class="keyword">class</span> T>
|
|
<a name="l00071"></a><a class="code" href="classeo_incrementor_param.html">00071</a> <span class="keyword">class </span><a class="code" href="classeo_incrementor_param.html">eoIncrementorParam</a> : <span class="keyword">public</span> <a class="code" href="classeo_updater.html">eoUpdater</a>, <span class="keyword">public</span> <a class="code" href="classeo_value_param.html">eoValueParam</a><T>
|
|
00072 {
|
|
00073 <span class="keyword">public</span>:
|
|
00074
|
|
00075 <span class="keyword">using</span> <a class="code" href="classeo_value_param.html">eoValueParam<T></a>::value;
|
|
00076
|
|
<a name="l00078"></a><a class="code" href="classeo_incrementor_param.html#a0">00078</a> <a class="code" href="classeo_incrementor_param.html#a0">eoIncrementorParam</a>( std::string _name, T _stepsize = 1) :
|
|
00079 <a class="code" href="classeo_value_param.html">eoValueParam</a><T>(T(0), _name), stepsize(_stepsize) {}
|
|
00080
|
|
<a name="l00084"></a><a class="code" href="classeo_incrementor_param.html#a1">00084</a> <a class="code" href="classeo_incrementor_param.html#a0">eoIncrementorParam</a>( std::string _name, T _countValue, T _stepsize) :
|
|
00085 <a class="code" href="classeo_value_param.html">eoValueParam</a><T>(_countValue, _name), stepsize(_stepsize) {}
|
|
00086
|
|
<a name="l00088"></a><a class="code" href="classeo_incrementor_param.html#a2">00088</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classeo_incrementor_param.html#a2">operator()</a>()
|
|
00089 {
|
|
00090 <a class="code" href="classeo_value_param.html#a2">value</a>() += stepsize;
|
|
00091 }
|
|
00092
|
|
00093 <span class="keyword">virtual</span> std::string className(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="stringliteral">"eoIncrementorParam"</span>; }
|
|
00094
|
|
00095 <span class="keyword">private</span>:
|
|
00096 T stepsize;
|
|
00097 };
|
|
00098
|
|
00099 <span class="preprocessor">#include <time.h></span>
|
|
00100
|
|
<a name="l00104"></a><a class="code" href="classeo_timed_state_saver.html">00104</a> <span class="keyword">class </span><a class="code" href="classeo_timed_state_saver.html">eoTimedStateSaver</a> : <span class="keyword">public</span> <a class="code" href="classeo_updater.html">eoUpdater</a>
|
|
00105 {
|
|
00106 <span class="keyword">public</span> :
|
|
00107 <a class="code" href="classeo_timed_state_saver.html">eoTimedStateSaver</a>(time_t _interval, <span class="keyword">const</span> <a class="code" href="classeo_state.html">eoState</a>& _state, std::string _prefix = <span class="stringliteral">"state"</span>, std::string _extension = <span class="stringliteral">"sav"</span>) : state(_state),
|
|
00108 interval(_interval), last_time(time(0)), first_time(time(0)),
|
|
00109 prefix(_prefix), extension(_extension) {}
|
|
00110
|
|
00111 <span class="keywordtype">void</span> <a class="code" href="classeo_timed_state_saver.html#a1">operator()</a>(<span class="keywordtype">void</span>);
|
|
00112
|
|
00113 <span class="keyword">virtual</span> std::string className(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="stringliteral">"eoTimedStateSaver"</span>; }
|
|
00114 <span class="keyword">private</span> :
|
|
00115 <span class="keyword">const</span> <a class="code" href="classeo_state.html">eoState</a>& state;
|
|
00116
|
|
00117 <span class="keyword">const</span> time_t interval;
|
|
00118 time_t last_time;
|
|
00119 <span class="keyword">const</span> time_t first_time;
|
|
00120 <span class="keyword">const</span> std::string prefix;
|
|
00121 <span class="keyword">const</span> std::string extension;
|
|
00122 };
|
|
00123
|
|
<a name="l00127"></a><a class="code" href="classeo_counted_state_saver.html">00127</a> <span class="keyword">class </span><a class="code" href="classeo_counted_state_saver.html">eoCountedStateSaver</a> : <span class="keyword">public</span> <a class="code" href="classeo_updater.html">eoUpdater</a>
|
|
00128 {
|
|
00129 <span class="keyword">public</span> :
|
|
00130 <a class="code" href="classeo_counted_state_saver.html">eoCountedStateSaver</a>(<span class="keywordtype">unsigned</span> _interval, <span class="keyword">const</span> <a class="code" href="classeo_state.html">eoState</a>& _state, std::string _prefix, <span class="keywordtype">bool</span> _saveOnLastCall, std::string _extension = <span class="stringliteral">"sav"</span>, <span class="keywordtype">unsigned</span> _counter = 0)
|
|
00131 : state(_state), interval(_interval), counter(_counter),
|
|
00132 saveOnLastCall(_saveOnLastCall),
|
|
00133 prefix(_prefix), extension(_extension) {}
|
|
00134
|
|
00135 <a class="code" href="classeo_counted_state_saver.html">eoCountedStateSaver</a>(<span class="keywordtype">unsigned</span> _interval, <span class="keyword">const</span> <a class="code" href="classeo_state.html">eoState</a>& _state, std::string _prefix = <span class="stringliteral">"state"</span>, std::string _extension = <span class="stringliteral">"sav"</span>, <span class="keywordtype">unsigned</span> _counter = 0)
|
|
00136 : state(_state), interval(_interval), counter(_counter),
|
|
00137 saveOnLastCall(<span class="keyword">true</span>),
|
|
00138 prefix(_prefix), extension(_extension) {}
|
|
00139
|
|
00140 <span class="keyword">virtual</span> <span class="keywordtype">void</span> lastCall(<span class="keywordtype">void</span>);
|
|
00141 <span class="keywordtype">void</span> <a class="code" href="classeo_counted_state_saver.html#a3">operator()</a>(<span class="keywordtype">void</span>);
|
|
00142
|
|
00143 <span class="keyword">virtual</span> std::string className(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="stringliteral">"eoCountedStateSaver"</span>; }
|
|
00144 <span class="keyword">private</span> :
|
|
00145 <span class="keywordtype">void</span> doItNow(<span class="keywordtype">void</span>);
|
|
00146
|
|
00147 <span class="keyword">const</span> <a class="code" href="classeo_state.html">eoState</a>& state;
|
|
00148 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> interval;
|
|
00149 <span class="keywordtype">unsigned</span> counter;
|
|
00150 <span class="keywordtype">bool</span> saveOnLastCall;
|
|
00151
|
|
00152 <span class="keyword">const</span> std::string prefix;
|
|
00153 <span class="keyword">const</span> std::string extension;
|
|
00154 };
|
|
00155
|
|
00156
|
|
00157 <span class="preprocessor">#endif</span>
|
|
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Oct 19 05:06:39 2006 for EO by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
|
|
</body>
|
|
</html>
|