paradiseo/trunk/paradiseo-peo/doc/html/peoAsyncIslandMig_8h-source.html
legrand 39cd826ea3 new design for the doc and the sources: licence ...
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@661 331e1502-861f-0410-8da2-ba01fb791d7f
2007-10-08 09:26:25 +00:00

217 lines
24 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>ParadisEO-PEOMovingObjects: peoAsyncIslandMig.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="classes.html"><span>Classes</span></a></li>
<li id="current"><a href="files.html"><span>Files</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul></div>
<h1>peoAsyncIslandMig.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* </span>
<a name="l00002"></a>00002 <span class="comment">* &lt;peoAsyncIslandMig.h&gt;</span>
<a name="l00003"></a>00003 <span class="comment">* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007</span>
<a name="l00004"></a>00004 <span class="comment">* (C) OPAC Team, LIFL, 2002-2007</span>
<a name="l00005"></a>00005 <span class="comment">*</span>
<a name="l00006"></a>00006 <span class="comment">* Sebastien Cahon, Alexandru-Adrian Tantar</span>
<a name="l00007"></a>00007 <span class="comment">*</span>
<a name="l00008"></a>00008 <span class="comment">* This software is governed by the CeCILL license under French law and</span>
<a name="l00009"></a>00009 <span class="comment">* abiding by the rules of distribution of free software. You can use,</span>
<a name="l00010"></a>00010 <span class="comment">* modify and/ or redistribute the software under the terms of the CeCILL</span>
<a name="l00011"></a>00011 <span class="comment">* license as circulated by CEA, CNRS and INRIA at the following URL</span>
<a name="l00012"></a>00012 <span class="comment">* "http://www.cecill.info".</span>
<a name="l00013"></a>00013 <span class="comment">*</span>
<a name="l00014"></a>00014 <span class="comment">* As a counterpart to the access to the source code and rights to copy,</span>
<a name="l00015"></a>00015 <span class="comment">* modify and redistribute granted by the license, users are provided only</span>
<a name="l00016"></a>00016 <span class="comment">* with a limited warranty and the software's author, the holder of the</span>
<a name="l00017"></a>00017 <span class="comment">* economic rights, and the successive licensors have only limited liability.</span>
<a name="l00018"></a>00018 <span class="comment">*</span>
<a name="l00019"></a>00019 <span class="comment">* In this respect, the user's attention is drawn to the risks associated</span>
<a name="l00020"></a>00020 <span class="comment">* with loading, using, modifying and/or developing or reproducing the</span>
<a name="l00021"></a>00021 <span class="comment">* software by the user in light of its specific status of free software,</span>
<a name="l00022"></a>00022 <span class="comment">* that may mean that it is complicated to manipulate, and that also</span>
<a name="l00023"></a>00023 <span class="comment">* therefore means that it is reserved for developers and experienced</span>
<a name="l00024"></a>00024 <span class="comment">* professionals having in-depth computer knowledge. Users are therefore</span>
<a name="l00025"></a>00025 <span class="comment">* encouraged to load and test the software's suitability as regards their</span>
<a name="l00026"></a>00026 <span class="comment">* requirements in conditions enabling the security of their systems and/or</span>
<a name="l00027"></a>00027 <span class="comment">* data to be ensured and, more generally, to use and operate it in the</span>
<a name="l00028"></a>00028 <span class="comment">* same conditions as regards security.</span>
<a name="l00029"></a>00029 <span class="comment">* The fact that you are presently reading this means that you have had</span>
<a name="l00030"></a>00030 <span class="comment">* knowledge of the CeCILL license and that you accept its terms.</span>
<a name="l00031"></a>00031 <span class="comment">*</span>
<a name="l00032"></a>00032 <span class="comment">* ParadisEO WebSite : http://paradiseo.gforge.inria.fr</span>
<a name="l00033"></a>00033 <span class="comment">* Contact: paradiseo-help@lists.gforge.inria.fr</span>
<a name="l00034"></a>00034 <span class="comment">*</span>
<a name="l00035"></a>00035 <span class="comment">*/</span>
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="preprocessor">#ifndef __peoAsyncIslandMig_h</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define __peoAsyncIslandMig_h</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;queue&gt;</span>
<a name="l00042"></a>00042
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;utils/eoUpdater.h&gt;</span>
<a name="l00044"></a>00044
<a name="l00045"></a>00045 <span class="preprocessor">#include &lt;eoContinue.h&gt;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;eoSelect.h&gt;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &lt;eoReplacement.h&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;eoPop.h&gt;</span>
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="preprocessor">#include "core/topology.h"</span>
<a name="l00051"></a>00051 <span class="preprocessor">#include "core/cooperative.h"</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include "core/eoPop_comm.h"</span>
<a name="l00053"></a>00053 <span class="preprocessor">#include "core/peo_debug.h"</span>
<a name="l00054"></a>00054
<a name="l00055"></a>00055
<a name="l00057"></a>00057
<a name="l00140"></a><a class="code" href="classpeoAsyncIslandMig.html">00140</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keyword">class </span><a class="code" href="classpeoAsyncIslandMig.html">peoAsyncIslandMig</a> : <span class="keyword">public</span> <a class="code" href="classCooperative.html">Cooperative</a>, <span class="keyword">public</span> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_updater.html">eoUpdater</a> {
<a name="l00141"></a>00141
<a name="l00142"></a>00142 <span class="keyword">public</span>:
<a name="l00143"></a>00143
<a name="l00153"></a>00153 <a class="code" href="classpeoAsyncIslandMig.html#e0f706cbf4148d3ca327227a5c7a9fdf">peoAsyncIslandMig</a>(
<a name="l00154"></a>00154 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_continue.html">eoContinue&lt; EOT &gt;</a>&amp; __cont,
<a name="l00155"></a>00155 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_select.html">eoSelect&lt; EOT &gt;</a>&amp; __select,
<a name="l00156"></a>00156 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_replacement.html">eoReplacement&lt; EOT &gt;</a>&amp; __replace,
<a name="l00157"></a>00157 <a class="code" href="classTopology.html">Topology</a>&amp; __topology,
<a name="l00158"></a>00158 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html">eoPop&lt; EOT &gt;</a>&amp; __source,
<a name="l00159"></a>00159 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html">eoPop&lt; EOT &gt;</a>&amp; __destination
<a name="l00160"></a>00160 );
<a name="l00161"></a>00161
<a name="l00166"></a>00166 <span class="keywordtype">void</span> <a class="code" href="classpeoAsyncIslandMig.html#13581e54425727a7f785ca8a6df527b5">operator()</a>();
<a name="l00167"></a>00167
<a name="l00169"></a>00169 <span class="keywordtype">void</span> <a class="code" href="classpeoAsyncIslandMig.html#6d790a5d0b6ac510cac4f61a1c0d8f16">pack</a>();
<a name="l00171"></a>00171 <span class="keywordtype">void</span> <a class="code" href="classpeoAsyncIslandMig.html#455501aee5db2bbfbae15779c8429369">unpack</a>();
<a name="l00172"></a>00172
<a name="l00173"></a>00173
<a name="l00174"></a>00174 <span class="keyword">private</span>:
<a name="l00175"></a>00175
<a name="l00176"></a>00176 <span class="keywordtype">void</span> <a class="code" href="classpeoAsyncIslandMig.html#87a4ef7d4bd30d349a801bf0f9e87c82">emigrate</a>();
<a name="l00177"></a>00177 <span class="keywordtype">void</span> <a class="code" href="classpeoAsyncIslandMig.html#5a9a64ba51a696e45f91b362c39c9a64">immigrate</a>();
<a name="l00178"></a>00178
<a name="l00179"></a>00179
<a name="l00180"></a>00180 <span class="keyword">private</span>:
<a name="l00181"></a>00181
<a name="l00182"></a><a class="code" href="classpeoAsyncIslandMig.html#2fc077d02ef9ea4595cfe883af0d4f83">00182</a> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_continue.html">eoContinue&lt; EOT &gt;</a>&amp; <a class="code" href="classpeoAsyncIslandMig.html#2fc077d02ef9ea4595cfe883af0d4f83">cont</a>; <span class="comment">// continuator</span>
<a name="l00183"></a><a class="code" href="classpeoAsyncIslandMig.html#b1fa045094c8a411323e75b5820c80c2">00183</a> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_select.html">eoSelect&lt; EOT &gt;</a>&amp; <a class="code" href="classpeoAsyncIslandMig.html#b1fa045094c8a411323e75b5820c80c2">select</a>; <span class="comment">// the selection strategy</span>
<a name="l00184"></a><a class="code" href="classpeoAsyncIslandMig.html#b761dbd880ee32e170741ecd78da6f48">00184</a> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_replacement.html">eoReplacement&lt; EOT &gt;</a>&amp; <a class="code" href="classpeoAsyncIslandMig.html#b761dbd880ee32e170741ecd78da6f48">replace</a>; <span class="comment">// the replacement strategy</span>
<a name="l00185"></a><a class="code" href="classpeoAsyncIslandMig.html#e45e5a808a96f0853ab6ba42339fe679">00185</a> <a class="code" href="classTopology.html">Topology</a>&amp; <a class="code" href="classpeoAsyncIslandMig.html#e45e5a808a96f0853ab6ba42339fe679">topology</a>; <span class="comment">// the neighboring topology</span>
<a name="l00186"></a>00186
<a name="l00187"></a>00187 <span class="comment">// source and destination populations</span>
<a name="l00188"></a><a class="code" href="classpeoAsyncIslandMig.html#8a502d82c773033e274dca932fc2d4ee">00188</a> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html">eoPop&lt; EOT &gt;</a>&amp; <a class="code" href="classpeoAsyncIslandMig.html#8a502d82c773033e274dca932fc2d4ee">source</a>;
<a name="l00189"></a><a class="code" href="classpeoAsyncIslandMig.html#e407f411d08ae7d96992603c145a7e43">00189</a> <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html">eoPop&lt; EOT &gt;</a>&amp; <a class="code" href="classpeoAsyncIslandMig.html#e407f411d08ae7d96992603c145a7e43">destination</a>;
<a name="l00190"></a>00190
<a name="l00191"></a>00191 <span class="comment">// immigrants &amp; emigrants in the queue</span>
<a name="l00192"></a><a class="code" href="classpeoAsyncIslandMig.html#b8c76d98d9ae99dd930a77c12860519a">00192</a> std :: queue&lt; eoPop&lt; EOT &gt; &gt; <a class="code" href="classpeoAsyncIslandMig.html#b8c76d98d9ae99dd930a77c12860519a">imm</a>;
<a name="l00193"></a><a class="code" href="classpeoAsyncIslandMig.html#a9cc0e2d61cac6e11647b141962adc89">00193</a> std :: queue&lt; eoPop&lt; EOT &gt; &gt; <a class="code" href="classpeoAsyncIslandMig.html#a9cc0e2d61cac6e11647b141962adc89">em</a>;
<a name="l00194"></a>00194
<a name="l00195"></a><a class="code" href="classpeoAsyncIslandMig.html#1a2c0004d23bc303420af137a8c8bd27">00195</a> std :: queue&lt; Cooperative* &gt; <a class="code" href="classpeoAsyncIslandMig.html#1a2c0004d23bc303420af137a8c8bd27">coop_em</a>;
<a name="l00196"></a>00196 };
<a name="l00197"></a>00197
<a name="l00198"></a>00198
<a name="l00199"></a><a class="code" href="classpeoAsyncIslandMig.html#e0f706cbf4148d3ca327227a5c7a9fdf">00199</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <a class="code" href="classpeoAsyncIslandMig.html#e0f706cbf4148d3ca327227a5c7a9fdf">peoAsyncIslandMig&lt; EOT &gt; :: peoAsyncIslandMig</a>(
<a name="l00200"></a>00200
<a name="l00201"></a>00201 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_continue.html">eoContinue&lt; EOT &gt;</a>&amp; __cont,
<a name="l00202"></a>00202 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_select.html">eoSelect&lt; EOT &gt;</a>&amp; __select,
<a name="l00203"></a>00203 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_replacement.html">eoReplacement&lt; EOT &gt;</a>&amp; __replace,
<a name="l00204"></a>00204 <a class="code" href="classTopology.html">Topology</a>&amp; __topology,
<a name="l00205"></a>00205 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html">eoPop&lt; EOT &gt;</a>&amp; __source,
<a name="l00206"></a>00206 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html">eoPop&lt; EOT &gt;</a>&amp; __destination
<a name="l00207"></a>00207
<a name="l00208"></a>00208 ) : cont( __cont ), select( __select ), replace( __replace ), topology( __topology ), source( __source ), destination( __destination )
<a name="l00209"></a>00209 {
<a name="l00210"></a>00210
<a name="l00211"></a>00211 __topology.<a class="code" href="classTopology.html#62bc46d8c20fdc71dad9e7c7a0d7aded">add</a>( *<span class="keyword">this</span> );
<a name="l00212"></a>00212 }
<a name="l00213"></a>00213
<a name="l00214"></a>00214
<a name="l00215"></a><a class="code" href="classpeoAsyncIslandMig.html#6d790a5d0b6ac510cac4f61a1c0d8f16">00215</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoAsyncIslandMig.html#6d790a5d0b6ac510cac4f61a1c0d8f16">peoAsyncIslandMig&lt; EOT &gt; :: pack</a>()
<a name="l00216"></a>00216 {
<a name="l00217"></a>00217
<a name="l00218"></a>00218 <a class="code" href="classCommunicable.html#e1f8bd1ee810fd73d44315c95998d19d">lock</a>(); {<a class="code" href="classpeoAsyncIslandMig.html#6d790a5d0b6ac510cac4f61a1c0d8f16"></a>
<a name="l00219"></a>00219 <a class="code" href="classpeoAsyncIslandMig.html#6d790a5d0b6ac510cac4f61a1c0d8f16"></a>
<a name="l00220"></a>00220 <a class="code" href="classpeoAsyncIslandMig.html#6d790a5d0b6ac510cac4f61a1c0d8f16"> :: pack</a>( <a class="code" href="classpeoAsyncIslandMig.html#1a2c0004d23bc303420af137a8c8bd27">coop_em</a>.front()-&gt;getKey() );<a class="code" href="classpeoAsyncIslandMig.html#6d790a5d0b6ac510cac4f61a1c0d8f16"></a>
<a name="l00221"></a>00221 <a class="code" href="classpeoAsyncIslandMig.html#6d790a5d0b6ac510cac4f61a1c0d8f16"> :: pack</a>( <a class="code" href="classpeoAsyncIslandMig.html#a9cc0e2d61cac6e11647b141962adc89">em</a>.front() );
<a name="l00222"></a>00222 <a class="code" href="classpeoAsyncIslandMig.html#1a2c0004d23bc303420af137a8c8bd27">coop_em</a>.pop();
<a name="l00223"></a>00223 <a class="code" href="classpeoAsyncIslandMig.html#a9cc0e2d61cac6e11647b141962adc89">em</a>.pop();
<a name="l00224"></a>00224 }
<a name="l00225"></a>00225 <a class="code" href="classCommunicable.html#caa814847192e71f434fbf9479ede862">unlock</a>();
<a name="l00226"></a>00226 }
<a name="l00227"></a>00227
<a name="l00228"></a>00228
<a name="l00229"></a><a class="code" href="classpeoAsyncIslandMig.html#455501aee5db2bbfbae15779c8429369">00229</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoAsyncIslandMig.html#455501aee5db2bbfbae15779c8429369">peoAsyncIslandMig&lt; EOT &gt; :: unpack</a>()
<a name="l00230"></a>00230 {
<a name="l00231"></a>00231
<a name="l00232"></a>00232 <a class="code" href="classCommunicable.html#e1f8bd1ee810fd73d44315c95998d19d">lock</a>(); {
<a name="l00233"></a>00233
<a name="l00234"></a>00234 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html">eoPop&lt; EOT &gt;</a> mig;<a class="code" href="classpeoAsyncIslandMig.html#455501aee5db2bbfbae15779c8429369"></a>
<a name="l00235"></a>00235 <a class="code" href="classpeoAsyncIslandMig.html#455501aee5db2bbfbae15779c8429369"> :: unpack</a>( mig );
<a name="l00236"></a>00236 <a class="code" href="classpeoAsyncIslandMig.html#b8c76d98d9ae99dd930a77c12860519a">imm</a>.push( mig );
<a name="l00237"></a>00237 }
<a name="l00238"></a>00238 <a class="code" href="classCommunicable.html#caa814847192e71f434fbf9479ede862">unlock</a>();
<a name="l00239"></a>00239 }
<a name="l00240"></a>00240
<a name="l00241"></a>00241
<a name="l00242"></a><a class="code" href="classpeoAsyncIslandMig.html#87a4ef7d4bd30d349a801bf0f9e87c82">00242</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoAsyncIslandMig.html#87a4ef7d4bd30d349a801bf0f9e87c82">peoAsyncIslandMig&lt; EOT &gt; :: emigrate</a>()
<a name="l00243"></a>00243 {
<a name="l00244"></a>00244
<a name="l00245"></a>00245 std :: vector&lt; Cooperative* &gt;in, out;
<a name="l00246"></a>00246 <a class="code" href="classpeoAsyncIslandMig.html#e45e5a808a96f0853ab6ba42339fe679">topology</a>.<a class="code" href="classTopology.html#86c006ad698649b2ba5016a5ddd619ce">setNeighbors</a>( <span class="keyword">this</span>, in, out );
<a name="l00247"></a>00247
<a name="l00248"></a>00248 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> i = 0; i &lt; out.size(); i++ ) {
<a name="l00249"></a>00249
<a name="l00250"></a>00250 <a class="codeRef" doxygen="eo.doxytag:http://eodev.sourceforge.net/eo/doc/html/" href="http://eodev.sourceforge.net/eo/doc/html/classeo_pop.html">eoPop&lt; EOT &gt;</a> mig;
<a name="l00251"></a>00251 <a class="code" href="classpeoAsyncIslandMig.html#b1fa045094c8a411323e75b5820c80c2">select</a>( <a class="code" href="classpeoAsyncIslandMig.html#8a502d82c773033e274dca932fc2d4ee">source</a>, mig );
<a name="l00252"></a>00252 <a class="code" href="classpeoAsyncIslandMig.html#a9cc0e2d61cac6e11647b141962adc89">em</a>.push( mig );
<a name="l00253"></a>00253 <a class="code" href="classpeoAsyncIslandMig.html#1a2c0004d23bc303420af137a8c8bd27">coop_em</a>.push( out[i] );
<a name="l00254"></a>00254 <a class="code" href="classCooperative.html#c609f2a1200da7d1ac96005602515fc6">send</a>( out[i] );
<a name="l00255"></a>00255 printDebugMessage( <span class="stringliteral">"sending some emigrants."</span> );
<a name="l00256"></a>00256 }
<a name="l00257"></a>00257 }
<a name="l00258"></a>00258
<a name="l00259"></a>00259
<a name="l00260"></a><a class="code" href="classpeoAsyncIslandMig.html#5a9a64ba51a696e45f91b362c39c9a64">00260</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoAsyncIslandMig.html#5a9a64ba51a696e45f91b362c39c9a64">peoAsyncIslandMig&lt; EOT &gt; :: immigrate</a>()
<a name="l00261"></a>00261 {
<a name="l00262"></a>00262
<a name="l00263"></a>00263 <a class="code" href="classCommunicable.html#e1f8bd1ee810fd73d44315c95998d19d">lock</a>(); {
<a name="l00264"></a>00264
<a name="l00265"></a>00265 <span class="keywordflow">while</span> ( !<a class="code" href="classpeoAsyncIslandMig.html#b8c76d98d9ae99dd930a77c12860519a">imm</a>.empty() ) {
<a name="l00266"></a>00266
<a name="l00267"></a>00267 <a class="code" href="classpeoAsyncIslandMig.html#b761dbd880ee32e170741ecd78da6f48">replace</a>( <a class="code" href="classpeoAsyncIslandMig.html#e407f411d08ae7d96992603c145a7e43">destination</a>, <a class="code" href="classpeoAsyncIslandMig.html#b8c76d98d9ae99dd930a77c12860519a">imm</a>.front() );
<a name="l00268"></a>00268 <a class="code" href="classpeoAsyncIslandMig.html#b8c76d98d9ae99dd930a77c12860519a">imm</a>.pop();
<a name="l00269"></a>00269 printDebugMessage( <span class="stringliteral">"receiving some immigrants."</span> );
<a name="l00270"></a>00270 }
<a name="l00271"></a>00271 }
<a name="l00272"></a>00272 <a class="code" href="classCommunicable.html#caa814847192e71f434fbf9479ede862">unlock</a>();
<a name="l00273"></a>00273 }
<a name="l00274"></a>00274
<a name="l00275"></a>00275
<a name="l00276"></a><a class="code" href="classpeoAsyncIslandMig.html#13581e54425727a7f785ca8a6df527b5">00276</a> <span class="keyword">template</span>&lt; <span class="keyword">class</span> EOT &gt; <span class="keywordtype">void</span> <a class="code" href="classpeoAsyncIslandMig.html#13581e54425727a7f785ca8a6df527b5">peoAsyncIslandMig&lt; EOT &gt; :: operator()</a>() {
<a name="l00277"></a>00277
<a name="l00278"></a>00278 <span class="keywordflow">if</span> ( !<a class="code" href="classpeoAsyncIslandMig.html#2fc077d02ef9ea4595cfe883af0d4f83">cont</a>( <a class="code" href="classpeoAsyncIslandMig.html#8a502d82c773033e274dca932fc2d4ee">source</a> ) ) {
<a name="l00279"></a>00279
<a name="l00280"></a>00280 <a class="code" href="classpeoAsyncIslandMig.html#87a4ef7d4bd30d349a801bf0f9e87c82">emigrate</a>(); <span class="comment">// sending emigrants</span>
<a name="l00281"></a>00281 <a class="code" href="classpeoAsyncIslandMig.html#5a9a64ba51a696e45f91b362c39c9a64">immigrate</a>(); <span class="comment">// receiving immigrants</span>
<a name="l00282"></a>00282 }
<a name="l00283"></a>00283 }
<a name="l00284"></a>00284
<a name="l00285"></a>00285
<a name="l00286"></a>00286 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Oct 8 11:16:46 2007 for ParadisEO-PEOMovingObjects by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>