git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@40 331e1502-861f-0410-8da2-ba01fb791d7f
165 lines
11 KiB
HTML
165 lines
11 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: eoCheckPoint.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>eoCheckPoint.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">// eoCheckPoint.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 _eoCheckPoint_h</span>
|
|
00028 <span class="preprocessor"></span><span class="preprocessor">#define _eoCheckPoint_h</span>
|
|
00029 <span class="preprocessor"></span>
|
|
00030 <span class="preprocessor">#include <eoContinue.h></span>
|
|
00031 <span class="preprocessor">#include <utils/eoUpdater.h></span>
|
|
00032 <span class="preprocessor">#include <utils/eoMonitor.h></span>
|
|
00033 <span class="preprocessor">#include <utils/eoStat.h></span>
|
|
00034
|
|
00045 <span class="keyword">template</span> <<span class="keyword">class</span> EOT>
|
|
<a name="l00046"></a><a class="code" href="classeo_check_point.html">00046</a> <span class="keyword">class </span><a class="code" href="classeo_check_point.html">eoCheckPoint</a> : <span class="keyword">public</span> <a class="code" href="classeo_continue.html">eoContinue</a><EOT>
|
|
00047 {
|
|
00048 <span class="keyword">public</span> :
|
|
00049
|
|
00050 <a class="code" href="classeo_check_point.html">eoCheckPoint</a>(<a class="code" href="classeo_continue.html">eoContinue<EOT></a>& _cont)
|
|
00051 {
|
|
00052 continuators.push_back(&_cont);
|
|
00053 }
|
|
00054
|
|
00055 <span class="keywordtype">bool</span> <a class="code" href="classeo_check_point.html#a1">operator()</a>(<span class="keyword">const</span> <a class="code" href="classeo_pop.html">eoPop<EOT></a>& _pop);
|
|
00056
|
|
00057 <span class="keywordtype">void</span> add(<a class="code" href="classeo_continue.html">eoContinue<EOT></a>& _cont) { continuators.push_back(&_cont); }
|
|
00058 <span class="keywordtype">void</span> add(<a class="code" href="classeo_sorted_stat_base.html">eoSortedStatBase<EOT></a>& _stat) { sorted.push_back(&_stat); }
|
|
00059 <span class="keywordtype">void</span> add(<a class="code" href="classeo_stat_base.html">eoStatBase<EOT></a>& _stat) { stats.push_back(&_stat); }
|
|
00060 <span class="keywordtype">void</span> add(<a class="code" href="classeo_monitor.html">eoMonitor</a>& _mon) { monitors.push_back(&_mon); }
|
|
00061 <span class="keywordtype">void</span> add(<a class="code" href="classeo_updater.html">eoUpdater</a>& _upd) { updaters.push_back(&_upd); }
|
|
00062
|
|
00063 <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">"eoCheckPoint"</span>; }
|
|
00064 std::string <a class="code" href="classeo_check_point.html#a8">allClassNames</a>() <span class="keyword">const </span>;
|
|
00065
|
|
00066 <span class="keyword">private</span> :
|
|
00067
|
|
00068 std::vector<eoContinue<EOT>*> continuators;
|
|
00069 std::vector<eoSortedStatBase<EOT>*> sorted;
|
|
00070 std::vector<eoStatBase<EOT>*> stats;
|
|
00071 std::vector<eoMonitor*> monitors;
|
|
00072 std::vector<eoUpdater*> updaters;
|
|
00073 };
|
|
00074
|
|
00075 <span class="keyword">template</span> <<span class="keyword">class</span> EOT>
|
|
<a name="l00076"></a><a class="code" href="classeo_check_point.html#a1">00076</a> <span class="keywordtype">bool</span> <a class="code" href="classeo_check_point.html#a1">eoCheckPoint<EOT>::operator()</a>(<span class="keyword">const</span> <a class="code" href="classeo_pop.html">eoPop<EOT></a>& _pop)
|
|
00077 {
|
|
00078 <span class="keywordtype">unsigned</span> i;
|
|
00079
|
|
00080 std::vector<const EOT*> sorted_pop;
|
|
00081 <span class="keywordflow">if</span> (!sorted.empty())
|
|
00082 {
|
|
00083 _pop.<a class="code" href="classeo_pop.html#a5">sort</a>(sorted_pop);
|
|
00084
|
|
00085 <span class="keywordflow">for</span> (i = 0; i < sorted.size(); ++i)
|
|
00086 {
|
|
00087 (*sorted[i])(sorted_pop);
|
|
00088 }
|
|
00089 }
|
|
00090
|
|
00091 <span class="keywordflow">for</span> (i = 0; i < stats.size(); ++i)
|
|
00092 (*stats[i])(_pop);
|
|
00093
|
|
00094 <span class="keywordflow">for</span> (i = 0; i < updaters.size(); ++i)
|
|
00095 (*updaters[i])();
|
|
00096
|
|
00097 <span class="keywordflow">for</span> (i = 0; i < monitors.size(); ++i)
|
|
00098 (*monitors[i])();
|
|
00099
|
|
00100 <span class="keywordtype">bool</span> bContinue = <span class="keyword">true</span>;
|
|
00101 <span class="keywordflow">for</span> (i = 0; i < continuators.size(); ++i)
|
|
00102 <span class="keywordflow">if</span> ( !(*continuators[i])(_pop) )
|
|
00103 bContinue = <span class="keyword">false</span>;
|
|
00104
|
|
00105 <span class="keywordflow">if</span> (! bContinue) <span class="comment">// we're going to stop: lastCall, gentlemen</span>
|
|
00106 {
|
|
00107 <span class="keywordflow">if</span> (!sorted.empty())
|
|
00108 {
|
|
00109 <span class="keywordflow">for</span> (i = 0; i < sorted.size(); ++i)
|
|
00110 {
|
|
00111 sorted[i]->lastCall(sorted_pop);
|
|
00112 }
|
|
00113 }
|
|
00114 <span class="keywordflow">for</span> (i = 0; i < stats.size(); ++i)
|
|
00115 stats[i]->lastCall(_pop);
|
|
00116
|
|
00117 <span class="keywordflow">for</span> (i = 0; i < updaters.size(); ++i)
|
|
00118 updaters[i]->lastCall();
|
|
00119
|
|
00120 <span class="keywordflow">for</span> (i = 0; i < monitors.size(); ++i)
|
|
00121 monitors[i]->lastCall();
|
|
00122 }
|
|
00123 <span class="keywordflow">return</span> bContinue;
|
|
00124 }
|
|
00125
|
|
00129 <span class="keyword">template</span> <<span class="keyword">class</span> EOT>
|
|
<a name="l00130"></a><a class="code" href="classeo_check_point.html#a8">00130</a> std::string <a class="code" href="classeo_check_point.html#a8">eoCheckPoint<EOT>::allClassNames</a>()<span class="keyword"> const</span>
|
|
00131 <span class="keyword"></span>{
|
|
00132 <span class="keywordtype">unsigned</span> i;
|
|
00133 std::string s = <span class="stringliteral">"\n"</span> + className() + <span class="stringliteral">"\n"</span>;
|
|
00134
|
|
00135 s += <span class="stringliteral">"Sorted Stats\n"</span>;
|
|
00136 <span class="keywordflow">for</span> (i = 0; i < sorted.size(); ++i)
|
|
00137 s += sorted[i]-><a class="code" href="classeo_pop.html#z19_1">className</a>() + <span class="stringliteral">"\n"</span>;
|
|
00138 s += <span class="stringliteral">"\n"</span>;
|
|
00139
|
|
00140 s += <span class="stringliteral">"Stats\n"</span>;
|
|
00141 <span class="keywordflow">for</span> (i = 0; i < stats.size(); ++i)
|
|
00142 s += stats[i]-><a class="code" href="classeo_pop.html#z19_1">className</a>() + <span class="stringliteral">"\n"</span>;
|
|
00143 s += <span class="stringliteral">"\n"</span>;
|
|
00144
|
|
00145 s += <span class="stringliteral">"Updaters\n"</span>;
|
|
00146 <span class="keywordflow">for</span> (i = 0; i < updaters.size(); ++i)
|
|
00147 s += updaters[i]-><a class="code" href="classeo_pop.html#z19_1">className</a>() + <span class="stringliteral">"\n"</span>;
|
|
00148 s += <span class="stringliteral">"\n"</span>;
|
|
00149
|
|
00150 s += <span class="stringliteral">"Monitors\n"</span>;
|
|
00151 <span class="keywordflow">for</span> (i = 0; i < monitors.size(); ++i)
|
|
00152 s += monitors[i]-><a class="code" href="classeo_pop.html#z19_1">className</a>() + <span class="stringliteral">"\n"</span>;
|
|
00153 s += <span class="stringliteral">"\n"</span>;
|
|
00154
|
|
00155 s += <span class="stringliteral">"Continuators\n"</span>;
|
|
00156 <span class="keywordflow">for</span> (i = 0; i < continuators.size(); ++i)
|
|
00157 s += continuators[i]-><a class="code" href="classeo_pop.html#z19_1">className</a>() + <span class="stringliteral">"\n"</span>;
|
|
00158 s += <span class="stringliteral">"\n"</span>;
|
|
00159
|
|
00160 <span class="keywordflow">return</span> s;
|
|
00161 }
|
|
00162
|
|
00163 <span class="preprocessor">#endif</span>
|
|
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Oct 19 05:06:34 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>
|