Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 54cac1c2268db633d66eeff1b4faa585 > files > 539

frepple-doc-0.8.1-3.fc15.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>C++ API frePPLe: problem.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="../styles.css" rel="stylesheet"  type="text/css">
</head>
<body>
<div id="container">

<div id="menubar"> 
<div id="logo" align="center">
<br/><img src='../frepple.bmp' alt="frepple" /><br/>
<a href='http://www.frepple.com/'>
<strong>a Free<br/>Production Planning<br/>Library</strong>
</a>
</div>
<div id="menu">
<br/>
<h3><a href='../Main/HomePage.html'>Main</a></h3>
<h3><a href='../UI/Main.html'>User Manual</a></h3>
<h3><a href='../Tutorial/Main.html'>Tutorial</a></h3>
<h3><a href='../Frepple/Main.html'>Reference Manual</a></h3>
<h3><a href='../Main/FAQ.html'>FAQ</a></h3>
<h3><a href='index.html'>C++ API</a></h3>
<br/>
</div>  
</div>

<div id="content">
<br/>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_88117dff2735251a69c8eb9084477714.html">src</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_25032d30b6d615a661c02e2ac1394b01.html">model</a>
  </div>
</div>
<div class="contents">
<h1>problem.cpp</h1><a href="a00227.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/***************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">  file : $URL: https://frepple.svn.sourceforge.net/svnroot/frepple/trunk/src/model/problem.cpp $</span>
<a name="l00003"></a>00003 <span class="comment">  version : $LastChangedRevision: 1315 $  $LastChangedBy: jdetaeye $</span>
<a name="l00004"></a>00004 <span class="comment">  date : $LastChangedDate: 2010-07-17 18:08:53 +0200 (Sat, 17 Jul 2010) $</span>
<a name="l00005"></a>00005 <span class="comment"> ***************************************************************************/</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="comment">/***************************************************************************</span>
<a name="l00008"></a>00008 <span class="comment"> *                                                                         *</span>
<a name="l00009"></a>00009 <span class="comment"> * Copyright (C) 2007-2010 by Johan De Taeye                               *</span>
<a name="l00010"></a>00010 <span class="comment"> *                                                                         *</span>
<a name="l00011"></a>00011 <span class="comment"> * This library is free software; you can redistribute it and/or modify it *</span>
<a name="l00012"></a>00012 <span class="comment"> * under the terms of the GNU Lesser General Public License as published   *</span>
<a name="l00013"></a>00013 <span class="comment"> * by the Free Software Foundation; either version 2.1 of the License, or  *</span>
<a name="l00014"></a>00014 <span class="comment"> * (at your option) any later version.                                     *</span>
<a name="l00015"></a>00015 <span class="comment"> *                                                                         *</span>
<a name="l00016"></a>00016 <span class="comment"> * This library is distributed in the hope that it will be useful,         *</span>
<a name="l00017"></a>00017 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of          *</span>
<a name="l00018"></a>00018 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *</span>
<a name="l00019"></a>00019 <span class="comment"> * General Public License for more details.                                *</span>
<a name="l00020"></a>00020 <span class="comment"> *                                                                         *</span>
<a name="l00021"></a>00021 <span class="comment"> * You should have received a copy of the GNU Lesser General Public        *</span>
<a name="l00022"></a>00022 <span class="comment"> * License along with this library; if not, write to the Free Software     *</span>
<a name="l00023"></a>00023 <span class="comment"> * Foundation Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 *</span>
<a name="l00024"></a>00024 <span class="comment"> * USA                                                                     *</span>
<a name="l00025"></a>00025 <span class="comment"> *                                                                         *</span>
<a name="l00026"></a>00026 <span class="comment"> ***************************************************************************/</span>
<a name="l00027"></a>00027 
<a name="l00028"></a><a class="code" href="a00227.html#a342983a479ae7a921be5face83fdb029">00028</a> <span class="preprocessor">#define FREPPLE_CORE</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="a00218.html">frepple/model.h</a>&quot;</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="keyword">namespace </span>frepple
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">bool</span> Plannable::anyChange = <span class="keyword">false</span>;
<a name="l00035"></a>00035 <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">bool</span> Plannable::computationBusy = <span class="keyword">false</span>;
<a name="l00036"></a>00036 <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keyword">const</span> <a class="code" href="a00114.html" title="A MetaCategory instance represents metadata for a category of object.">MetaCategory</a>* <a class="code" href="a00134.html#a9e707be88274a5c5d7bc4c71f2ea1338">Problem::metadata</a>;
<a name="l00037"></a>00037 <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keyword">const</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>* <a class="code" href="a00145.html#ac6f6be43c695f9298f4ac95292906319">ProblemMaterialExcess::metadata</a>,
<a name="l00038"></a>00038   *<a class="code" href="a00146.html#aabbcfbf928d9353d5be6097a1d05942c">ProblemMaterialShortage::metadata</a>,
<a name="l00039"></a>00039   *<a class="code" href="a00141.html#a4e6592a41b83e966a3a8df59b44a27e4">ProblemExcess::metadata</a>,
<a name="l00040"></a>00040   *<a class="code" href="a00148.html#a0a9c872d51817d6a7cf8736e5ad3aaf9">ProblemShort::metadata</a>,
<a name="l00041"></a>00041   *<a class="code" href="a00140.html#abf3dfbf6f5b6e0880e76feb008872728">ProblemEarly::metadata</a>,
<a name="l00042"></a>00042   *<a class="code" href="a00144.html#a33185ea2e94702f670e163c3f5de6b1e">ProblemLate::metadata</a>,
<a name="l00043"></a>00043   *<a class="code" href="a00142.html#a5d8c463f13053c0527013927e8b737ee">ProblemInvalidData::metadata</a>,
<a name="l00044"></a>00044   *<a class="code" href="a00139.html#a3380f2e8ec96f239a3712dc1b93c4282">ProblemDemandNotPlanned::metadata</a>,
<a name="l00045"></a>00045   *<a class="code" href="a00147.html#af89b5d820370b17b6b6733617c51de81">ProblemPrecedence::metadata</a>,
<a name="l00046"></a>00046   *<a class="code" href="a00136.html#abd86b7cbefa986340a2b6d80c9aeab17">ProblemBeforeFence::metadata</a>,
<a name="l00047"></a>00047   *<a class="code" href="a00135.html#aa55a9bf686195db07c0fa8723c2479f2">ProblemBeforeCurrent::metadata</a>,
<a name="l00048"></a>00048   *<a class="code" href="a00138.html#a06ab88f4c56687c0697b6609e196dff8">ProblemCapacityUnderload::metadata</a>,
<a name="l00049"></a>00049   *<a class="code" href="a00137.html#ae943a0ede255ced55bc8ac355c50fff6">ProblemCapacityOverload::metadata</a>;
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 
<a name="l00052"></a><a class="code" href="a00134.html#ae6d44efda41e2197216ba1d0e7cb2d90">00052</a> <span class="keywordtype">int</span> <a class="code" href="a00134.html#ae6d44efda41e2197216ba1d0e7cb2d90">Problem::initialize</a>()
<a name="l00053"></a>00053 {
<a name="l00054"></a>00054   <span class="comment">// Initialize the problem metadata.</span>
<a name="l00055"></a>00055   <a class="code" href="a00134.html#a9e707be88274a5c5d7bc4c71f2ea1338">Problem::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00114.html" title="A MetaCategory instance represents metadata for a category of object.">MetaCategory</a>
<a name="l00056"></a>00056     (<span class="stringliteral">&quot;problem&quot;</span>, <span class="stringliteral">&quot;problems&quot;</span>, NULL, <a class="code" href="a00134.html#ab40e26683cdfa2c097fb04648ddea01e">Problem::writer</a>);
<a name="l00057"></a>00057   <a class="code" href="a00145.html#ac6f6be43c695f9298f4ac95292906319">ProblemMaterialExcess::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00058"></a>00058     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;material excess&quot;</span>);
<a name="l00059"></a>00059   <a class="code" href="a00146.html#aabbcfbf928d9353d5be6097a1d05942c">ProblemMaterialShortage::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00060"></a>00060     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;material shortage&quot;</span>);
<a name="l00061"></a>00061   <a class="code" href="a00141.html#a4e6592a41b83e966a3a8df59b44a27e4">ProblemExcess::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00062"></a>00062     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;excess&quot;</span>);
<a name="l00063"></a>00063   <a class="code" href="a00148.html#a0a9c872d51817d6a7cf8736e5ad3aaf9">ProblemShort::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00064"></a>00064     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;short&quot;</span>);
<a name="l00065"></a>00065   <a class="code" href="a00140.html#abf3dfbf6f5b6e0880e76feb008872728">ProblemEarly::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00066"></a>00066     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;early&quot;</span>);
<a name="l00067"></a>00067   <a class="code" href="a00144.html#a33185ea2e94702f670e163c3f5de6b1e">ProblemLate::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00068"></a>00068     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;late&quot;</span>);
<a name="l00069"></a>00069   <a class="code" href="a00142.html#a5d8c463f13053c0527013927e8b737ee">ProblemInvalidData::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00070"></a>00070     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;invalid data&quot;</span>);
<a name="l00071"></a>00071   <a class="code" href="a00139.html#a3380f2e8ec96f239a3712dc1b93c4282">ProblemDemandNotPlanned::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00072"></a>00072     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;unplanned&quot;</span>);
<a name="l00073"></a>00073   <a class="code" href="a00147.html#af89b5d820370b17b6b6733617c51de81">ProblemPrecedence::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00074"></a>00074     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;precedence&quot;</span>);
<a name="l00075"></a>00075   <a class="code" href="a00136.html#abd86b7cbefa986340a2b6d80c9aeab17">ProblemBeforeFence::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00076"></a>00076     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;before fence&quot;</span>);
<a name="l00077"></a>00077   <a class="code" href="a00135.html#aa55a9bf686195db07c0fa8723c2479f2">ProblemBeforeCurrent::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00078"></a>00078     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;before current&quot;</span>);
<a name="l00079"></a>00079   <a class="code" href="a00138.html#a06ab88f4c56687c0697b6609e196dff8">ProblemCapacityUnderload::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00080"></a>00080     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;underload&quot;</span>);
<a name="l00081"></a>00081   <a class="code" href="a00137.html#ae943a0ede255ced55bc8ac355c50fff6">ProblemCapacityOverload::metadata</a> = <span class="keyword">new</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>
<a name="l00082"></a>00082     (<span class="stringliteral">&quot;problem&quot;</span>,<span class="stringliteral">&quot;overload&quot;</span>);
<a name="l00083"></a>00083 
<a name="l00084"></a>00084   <span class="comment">// Initialize the Python type</span>
<a name="l00085"></a>00085   <a class="code" href="a00155.html" title="This class is a thin wrapper around the type information in Python.">PythonType</a>&amp; x = <a class="code" href="a00134.html#a8a73cf77f0bed3a807e65f9844d9baf4">PythonExtension&lt;Problem&gt;::getType</a>();
<a name="l00086"></a>00086   x.<a class="code" href="a00155.html#af9217b67c7c60e8e87c703066d6970d5">setName</a>(<span class="stringliteral">&quot;problem&quot;</span>);
<a name="l00087"></a>00087   x.<a class="code" href="a00155.html#aaafe003660694b2cf497a89815d7fe49">setDoc</a>(<span class="stringliteral">&quot;frePPLe problem&quot;</span>);
<a name="l00088"></a>00088   x.<a class="code" href="a00155.html#a8d3f24e0357f41ac3bc0be78bd2ab268">supportgetattro</a>();
<a name="l00089"></a>00089   x.<a class="code" href="a00155.html#a23a670ed39c26ab20ec400cbe3618e6c">supportstr</a>();
<a name="l00090"></a>00090   x.<a class="code" href="a00155.html#ab5950f891179f3ae7d31f4977580cb1d">addMethod</a>(<span class="stringliteral">&quot;toXML&quot;</span>, <a class="code" href="a00120.html#a936a4ac5b81ba4f9c9cbe54b9aeeda13">toXML</a>, METH_VARARGS, <span class="stringliteral">&quot;return a XML representation&quot;</span>);
<a name="l00091"></a>00091   <span class="keyword">const_cast&lt;</span><a class="code" href="a00114.html" title="A MetaCategory instance represents metadata for a category of object.">MetaCategory</a>*<span class="keyword">&gt;</span>(<a class="code" href="a00134.html#a9e707be88274a5c5d7bc4c71f2ea1338">metadata</a>)-&gt;pythonClass = x.<a class="code" href="a00155.html#aed0915f1cc32c0c1e12e209abfedf615">type_object</a>();
<a name="l00092"></a>00092   <span class="keywordflow">return</span> x.<a class="code" href="a00155.html#a5b2be5d75982b077b2d694c269d43778">typeReady</a>();
<a name="l00093"></a>00093 }
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 
<a name="l00096"></a><a class="code" href="a00134.html#a2f71c4ed90e3ed268a804550a45b0cb3">00096</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">bool</span> <a class="code" href="a00134.html#a2f71c4ed90e3ed268a804550a45b0cb3">Problem::operator &lt; </a>(<span class="keyword">const</span> <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a>&amp; a)<span class="keyword"> const</span>
<a name="l00097"></a>00097 <span class="keyword"></span>{
<a name="l00098"></a>00098   <span class="comment">// 1. Sort based on entity</span>
<a name="l00099"></a>00099   assert(<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a> == a.<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>);
<a name="l00100"></a>00100 
<a name="l00101"></a>00101   <span class="comment">// 2. Sort based on type</span>
<a name="l00102"></a>00102   <span class="keywordflow">if</span> (<a class="code" href="a00134.html#a8a73cf77f0bed3a807e65f9844d9baf4">getType</a>() != a.<a class="code" href="a00134.html#a8a73cf77f0bed3a807e65f9844d9baf4">getType</a>()) <span class="keywordflow">return</span> <a class="code" href="a00134.html#a8a73cf77f0bed3a807e65f9844d9baf4">getType</a>() &lt; a.<a class="code" href="a00134.html#a8a73cf77f0bed3a807e65f9844d9baf4">getType</a>();
<a name="l00103"></a>00103 
<a name="l00104"></a>00104   <span class="comment">// 3. Sort based on start date</span>
<a name="l00105"></a>00105   <span class="keywordflow">return</span> <a class="code" href="a00134.html#af283f4815d85c0b33d112efe4435737b">getDates</a>().<a class="code" href="a00050.html#a73e574de7fbf5df8ebc4c5190e7d49c3">getStart</a>() &lt; a.<a class="code" href="a00134.html#af283f4815d85c0b33d112efe4435737b">getDates</a>().<a class="code" href="a00050.html#a73e574de7fbf5df8ebc4c5190e7d49c3">getStart</a>();
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107 
<a name="l00108"></a>00108 
<a name="l00109"></a><a class="code" href="a00134.html#a4a54565c28b3f557882917db82415c7c">00109</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00134.html#a4a54565c28b3f557882917db82415c7c">Problem::addProblem</a>()
<a name="l00110"></a>00110 {
<a name="l00111"></a>00111   assert(<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>);
<a name="l00112"></a>00112   <span class="keywordflow">if</span> ((<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem &amp;&amp; *<span class="keyword">this</span> &lt; *(<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem))
<a name="l00113"></a>00113       || !<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem)
<a name="l00114"></a>00114   {
<a name="l00115"></a>00115     <span class="comment">// Insert as the first problem in the list</span>
<a name="l00116"></a>00116     <a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a> = <a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem;
<a name="l00117"></a>00117     <a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem = <span class="keyword">this</span>;
<a name="l00118"></a>00118   }
<a name="l00119"></a>00119   <span class="keywordflow">else</span>
<a name="l00120"></a>00120   {
<a name="l00121"></a>00121     <span class="comment">// Insert in the middle or at the end of the list</span>
<a name="l00122"></a>00122     <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a>* curProblem = <a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>;
<a name="l00123"></a>00123     <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a>* prevProblem = <a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem;
<a name="l00124"></a>00124     <span class="keywordflow">while</span> (curProblem &amp;&amp; !(*<span class="keyword">this</span> &lt; *curProblem))
<a name="l00125"></a>00125     {
<a name="l00126"></a>00126       prevProblem = curProblem;
<a name="l00127"></a>00127       curProblem = curProblem-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>;
<a name="l00128"></a>00128     }
<a name="l00129"></a>00129     <a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a> = curProblem;
<a name="l00130"></a>00130     prevProblem-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a> = <span class="keyword">this</span>;
<a name="l00131"></a>00131   }
<a name="l00132"></a>00132 }
<a name="l00133"></a>00133 
<a name="l00134"></a>00134 
<a name="l00135"></a><a class="code" href="a00134.html#a2960a1116a82c6d0f3351229667a122e">00135</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00134.html#a2960a1116a82c6d0f3351229667a122e">Problem::removeProblem</a>()
<a name="l00136"></a>00136 {
<a name="l00137"></a>00137   <span class="comment">// Fast delete method: the code triggering this method is responsible of</span>
<a name="l00138"></a>00138   <span class="comment">// maintaining the problem container</span>
<a name="l00139"></a>00139   <span class="keywordflow">if</span> (!<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>) <span class="keywordflow">return</span>;
<a name="l00140"></a>00140 
<a name="l00141"></a>00141   <span class="keywordflow">if</span> (<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem == <span class="keyword">this</span>)
<a name="l00142"></a>00142     <span class="comment">// Removal from the head of the list</span>
<a name="l00143"></a>00143     <a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem = <a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>;
<a name="l00144"></a>00144   <span class="keywordflow">else</span>
<a name="l00145"></a>00145   {
<a name="l00146"></a>00146     <span class="comment">// Removal from the middle of the list</span>
<a name="l00147"></a>00147     <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *prev = <a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem;
<a name="l00148"></a>00148     <span class="keywordflow">for</span> (<a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a>* cur = <a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a>-&gt;firstProblem; cur; cur=cur-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>)
<a name="l00149"></a>00149     {
<a name="l00150"></a>00150       <span class="keywordflow">if</span> (cur == <span class="keyword">this</span>)
<a name="l00151"></a>00151       {
<a name="l00152"></a>00152         <span class="comment">// Found it!</span>
<a name="l00153"></a>00153         prev-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a> = <a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>;
<a name="l00154"></a>00154         <span class="keywordflow">return</span>;
<a name="l00155"></a>00155       }
<a name="l00156"></a>00156       prev = cur;
<a name="l00157"></a>00157     }
<a name="l00158"></a>00158     <span class="comment">// The problem wasn&apos;t found in the list. This shouldn&apos;t happen...</span>
<a name="l00159"></a>00159     <span class="keywordflow">throw</span> <a class="code" href="a00111.html" title="An exception of this type is thrown when the library gets in an inconsistent state...">LogicException</a>(<span class="stringliteral">&quot;Corrupted problem list&quot;</span>);
<a name="l00160"></a>00160   }
<a name="l00161"></a>00161 }
<a name="l00162"></a>00162 
<a name="l00163"></a>00163 
<a name="l00164"></a><a class="code" href="a00133.html#a1bd0cabdb794a96725c03c2a74aa3662">00164</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00133.html#a1bd0cabdb794a96725c03c2a74aa3662">Plannable::setDetectProblems</a>(<span class="keywordtype">bool</span> b)
<a name="l00165"></a>00165 {
<a name="l00166"></a>00166   <span class="keywordflow">if</span> (useProblemDetection &amp;&amp; !b)
<a name="l00167"></a>00167     <span class="comment">// We are switching from &apos;yes&apos; to &apos;no&apos;: delete all existing problems</span>
<a name="l00168"></a>00168     <a class="code" href="a00134.html#a53c01969a6eae0dbfff416560242b454">Problem::clearProblems</a>(*<span class="keyword">this</span>);
<a name="l00169"></a>00169   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!useProblemDetection &amp;&amp; b)
<a name="l00170"></a>00170     <span class="comment">// We are switching from &apos;no&apos; to &apos;yes&apos;: mark as changed for the next</span>
<a name="l00171"></a>00171     <span class="comment">// problem detection call</span>
<a name="l00172"></a>00172     <a class="code" href="a00133.html#a11a86a6e020664a337325a96a64f6d2c">setChanged</a>();
<a name="l00173"></a>00173   <span class="comment">// Update the flag</span>
<a name="l00174"></a>00174   useProblemDetection=b;
<a name="l00175"></a>00175 }
<a name="l00176"></a>00176 
<a name="l00177"></a>00177 
<a name="l00178"></a><a class="code" href="a00133.html#a53bdeef1e395514631372ae74b596b2a">00178</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00133.html#a53bdeef1e395514631372ae74b596b2a">Plannable::computeProblems</a>()
<a name="l00179"></a>00179 {
<a name="l00180"></a>00180   <span class="comment">// Exit immediately if the list is up to date</span>
<a name="l00181"></a>00181   <span class="keywordflow">if</span> (!anyChange &amp;&amp; !computationBusy) <span class="keywordflow">return</span>;
<a name="l00182"></a>00182 
<a name="l00183"></a>00183   computationBusy = <span class="keyword">true</span>;
<a name="l00184"></a>00184   <span class="comment">// Get exclusive access to this function in a multi-threaded environment.</span>
<a name="l00185"></a>00185   <span class="keyword">static</span> <a class="code" href="a00117.html" title="This class is a wrapper around platform specific mutex functions.">Mutex</a> computationbusy;
<a name="l00186"></a>00186   {
<a name="l00187"></a>00187     <a class="code" href="a00163.html" title="This is a convenience class that makes it easy (and exception-safe) to lock a mutex...">ScopeMutexLock</a> l(computationbusy);
<a name="l00188"></a>00188 
<a name="l00189"></a>00189     <span class="comment">// Another thread may already have computed it while this thread was</span>
<a name="l00190"></a>00190     <span class="comment">// waiting for the lock</span>
<a name="l00191"></a>00191     <span class="keywordflow">while</span> (anyChange)
<a name="l00192"></a>00192     {
<a name="l00193"></a>00193       <span class="comment">// Reset to change flag. Note that during the computation the flag</span>
<a name="l00194"></a>00194       <span class="comment">// could be switched on again by some model change in a different thread.</span>
<a name="l00195"></a>00195       anyChange = <span class="keyword">false</span>;
<a name="l00196"></a>00196 
<a name="l00197"></a>00197       <span class="comment">// Loop through all entities</span>
<a name="l00198"></a>00198       <span class="keywordflow">for</span> (<a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">HasProblems::EntityIterator</a> i; i!=<a class="code" href="a00086.html#a6ac8107c2f5208d4cdf46f20c3b41228">HasProblems::endEntity</a>(); ++i)
<a name="l00199"></a>00199       {
<a name="l00200"></a>00200         <a class="code" href="a00133.html" title="This class needs to be implemented by all classes that implement dynamic behavior...">Plannable</a> *e = i-&gt;getEntity();
<a name="l00201"></a>00201         <span class="keywordflow">if</span> (e-&gt;<a class="code" href="a00133.html#ad9ce53f3b9bdc55b7a9832cdfb991b87">getChanged</a>() &amp;&amp; e-&gt;<a class="code" href="a00133.html#a060a1f4f9488fb2f287470127b59f5ec">getDetectProblems</a>()) i-&gt;updateProblems();
<a name="l00202"></a>00202       }
<a name="l00203"></a>00203 
<a name="l00204"></a>00204       <span class="comment">// Mark the entities as unchanged</span>
<a name="l00205"></a>00205       <span class="keywordflow">for</span> (<a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">HasProblems::EntityIterator</a> j; j!=<a class="code" href="a00086.html#a6ac8107c2f5208d4cdf46f20c3b41228">HasProblems::endEntity</a>(); ++j)
<a name="l00206"></a>00206       {
<a name="l00207"></a>00207         <a class="code" href="a00133.html" title="This class needs to be implemented by all classes that implement dynamic behavior...">Plannable</a> *e = j-&gt;getEntity();
<a name="l00208"></a>00208         <span class="keywordflow">if</span> (e-&gt;<a class="code" href="a00133.html#ad9ce53f3b9bdc55b7a9832cdfb991b87">getChanged</a>() &amp;&amp; e-&gt;<a class="code" href="a00133.html#a060a1f4f9488fb2f287470127b59f5ec">getDetectProblems</a>()) e-&gt;<a class="code" href="a00133.html#a11a86a6e020664a337325a96a64f6d2c">setChanged</a>(<span class="keyword">false</span>);
<a name="l00209"></a>00209       }
<a name="l00210"></a>00210     }
<a name="l00211"></a>00211 
<a name="l00212"></a>00212     <span class="comment">// Unlock the exclusive access to this function</span>
<a name="l00213"></a>00213     computationBusy = <span class="keyword">false</span>;
<a name="l00214"></a>00214   }
<a name="l00215"></a>00215 }
<a name="l00216"></a>00216 
<a name="l00217"></a>00217 
<a name="l00218"></a><a class="code" href="a00133.html#af52c6c3386a937db2bc91a1950622462">00218</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00133.html#af52c6c3386a937db2bc91a1950622462">Plannable::writeElement</a> (<a class="code" href="a00189.html" title="Base class for writing XML formatted data to an output stream.">XMLOutput</a>* o, <span class="keyword">const</span> <a class="code" href="a00096.html" title="This class defines a keyword for the frePPLe data model.">Keyword</a>&amp; tag, <a class="code" href="a00257.html#a20c2c7e4c6b668e71c154ae3eb18f398">mode</a> m)<span class="keyword"> const</span>
<a name="l00219"></a>00219 <span class="keyword"></span>{
<a name="l00220"></a>00220   <span class="comment">// We don&apos;t bother about the mode, since this method is only called from</span>
<a name="l00221"></a>00221   <span class="comment">// within the writeElement() method of other classes.</span>
<a name="l00222"></a>00222 
<a name="l00223"></a>00223   <span class="comment">// Problem detection flag only written if different from the default value</span>
<a name="l00224"></a>00224   <span class="keywordflow">if</span> (!<a class="code" href="a00133.html#a060a1f4f9488fb2f287470127b59f5ec">getDetectProblems</a>()) o-&gt;<a class="code" href="a00189.html#a711922eea4cfe3c33b97e4188dacc7d2">writeElement</a>(<a class="code" href="a00177.html#a3496eb45fc0649c76a3d71c8be11d8e2">Tags::tag_detectproblems</a>, <span class="keyword">false</span>);
<a name="l00225"></a>00225 }
<a name="l00226"></a>00226 
<a name="l00227"></a>00227 
<a name="l00228"></a><a class="code" href="a00133.html#adbaec4d97d9773b4eb1d63ea935d75ba">00228</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00133.html#adbaec4d97d9773b4eb1d63ea935d75ba">Plannable::endElement</a>(<a class="code" href="a00186.html" title="This class will read in an XML-file and call the appropriate handler functions of...">XMLInput</a>&amp; pIn, <span class="keyword">const</span> <a class="code" href="a00002.html" title="A class to model keyword instances.">Attribute</a>&amp; pAttr, <span class="keyword">const</span> <a class="code" href="a00047.html" title="This abstract class represents a attribute and value pair for updating objects in...">DataElement</a>&amp; pElement)
<a name="l00229"></a>00229 {
<a name="l00230"></a>00230   <span class="keywordflow">if</span> (pAttr.<a class="code" href="a00002.html#aebffce6c4fcf1696ca34f63f2b6ee091">isA</a> (<a class="code" href="a00177.html#a3496eb45fc0649c76a3d71c8be11d8e2">Tags::tag_detectproblems</a>))
<a name="l00231"></a>00231   {
<a name="l00232"></a>00232     <span class="keywordtype">bool</span> b = pElement.<a class="code" href="a00047.html#a542b814710b3242bd4c81aad2fc269d8">getBool</a>();
<a name="l00233"></a>00233     <a class="code" href="a00133.html#a1bd0cabdb794a96725c03c2a74aa3662">setDetectProblems</a>(b);
<a name="l00234"></a>00234   }
<a name="l00235"></a>00235 }
<a name="l00236"></a>00236 
<a name="l00237"></a>00237 
<a name="l00238"></a><a class="code" href="a00134.html#a53c01969a6eae0dbfff416560242b454">00238</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00134.html#a53c01969a6eae0dbfff416560242b454">Problem::clearProblems</a>()
<a name="l00239"></a>00239 {
<a name="l00240"></a>00240   <span class="comment">// Loop through all entities, and call clearProblems(i)</span>
<a name="l00241"></a>00241   <span class="keywordflow">for</span> (<a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">HasProblems::EntityIterator</a> i = <a class="code" href="a00086.html#adcb3e4396766daeac438fa874e0b92a8">HasProblems::beginEntity</a>();
<a name="l00242"></a>00242       i != <a class="code" href="a00086.html#a6ac8107c2f5208d4cdf46f20c3b41228">HasProblems::endEntity</a>(); ++i)
<a name="l00243"></a>00243   {
<a name="l00244"></a>00244     <a class="code" href="a00134.html#a53c01969a6eae0dbfff416560242b454">clearProblems</a>(*i);
<a name="l00245"></a>00245     i-&gt;getEntity()-&gt;setChanged(<span class="keyword">true</span>);
<a name="l00246"></a>00246   }
<a name="l00247"></a>00247 }
<a name="l00248"></a>00248 
<a name="l00249"></a>00249 
<a name="l00250"></a><a class="code" href="a00134.html#a0f7f4dca83f15c8807b6f7a4b0733bd5">00250</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00134.html#a53c01969a6eae0dbfff416560242b454">Problem::clearProblems</a>(<a class="code" href="a00086.html" title="Classes that keep track of problem conditions need to implement this class.">HasProblems</a>&amp; p, <span class="keywordtype">bool</span> setchanged)
<a name="l00251"></a>00251 {
<a name="l00252"></a>00252   <span class="comment">// Nothing to do</span>
<a name="l00253"></a>00253   <span class="keywordflow">if</span> (!p.firstProblem) <span class="keywordflow">return</span>;
<a name="l00254"></a>00254 
<a name="l00255"></a>00255   <span class="comment">// Delete all problems in the list</span>
<a name="l00256"></a>00256   <span class="keywordflow">for</span> (<a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *cur=p.firstProblem; cur; )
<a name="l00257"></a>00257   {
<a name="l00258"></a>00258     <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *del = cur;
<a name="l00259"></a>00259     cur = cur-&gt;nextProblem;
<a name="l00260"></a>00260     del-&gt;<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a> = NULL;
<a name="l00261"></a>00261     <span class="keyword">delete</span> del;
<a name="l00262"></a>00262   }
<a name="l00263"></a>00263   p.firstProblem = NULL;
<a name="l00264"></a>00264 
<a name="l00265"></a>00265   <span class="comment">// Mark as changed</span>
<a name="l00266"></a>00266   <span class="keywordflow">if</span> (setchanged) p.<a class="code" href="a00086.html#a97837ce18709d6ee5535f15f39b1676b">getEntity</a>()-&gt;<a class="code" href="a00133.html#a11a86a6e020664a337325a96a64f6d2c">setChanged</a>();
<a name="l00267"></a>00267 }
<a name="l00268"></a>00268 
<a name="l00269"></a>00269 
<a name="l00270"></a><a class="code" href="a00134.html#ab40e26683cdfa2c097fb04648ddea01e">00270</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00134.html#ab40e26683cdfa2c097fb04648ddea01e">Problem::writer</a>(<span class="keyword">const</span> <a class="code" href="a00114.html" title="A MetaCategory instance represents metadata for a category of object.">MetaCategory</a>* c, <a class="code" href="a00189.html" title="Base class for writing XML formatted data to an output stream.">XMLOutput</a>* o)
<a name="l00271"></a>00271 {
<a name="l00272"></a>00272   <a class="code" href="a00039.html" title="This class models an STL-like iterator that allows us to iterate over the named entities...">const_iterator</a> piter = <a class="code" href="a00134.html#a1532b2bb7078ebcd527a8bf332ffb861">begin</a>();
<a name="l00273"></a>00273   <span class="keywordflow">if</span> (piter != <a class="code" href="a00134.html#ae3fc9d1129b3e956ac2c9ec6c54035d8">end</a>())
<a name="l00274"></a>00274   {
<a name="l00275"></a>00275     o-&gt;<a class="code" href="a00189.html#a5c1811dae2e3eae344ad366f6441a8a5">BeginObject</a>(*c-&gt;<a class="code" href="a00114.html#abf52fd75f82c4de4091e3b1921b43ba5">grouptag</a>);
<a name="l00276"></a>00276     <span class="keywordflow">for</span> (; piter!=<a class="code" href="a00134.html#ae3fc9d1129b3e956ac2c9ec6c54035d8">end</a>(); ++piter)
<a name="l00277"></a>00277       <span class="comment">// Note: not the regular write, but a fast write to speed things up.</span>
<a name="l00278"></a>00278       <span class="comment">// This is possible since problems aren&apos;t nested and are never</span>
<a name="l00279"></a>00279       <span class="comment">// referenced.</span>
<a name="l00280"></a>00280       piter-&gt;writeElement(o, *c-&gt;<a class="code" href="a00115.html#aace20f59ef5a9de3188cb9810398932b">typetag</a>);
<a name="l00281"></a>00281     o-&gt;<a class="code" href="a00189.html#a05375aa593bb0514020b035411c8983c">EndObject</a>(*c-&gt;<a class="code" href="a00114.html#abf52fd75f82c4de4091e3b1921b43ba5">grouptag</a>);
<a name="l00282"></a>00282   }
<a name="l00283"></a>00283 }
<a name="l00284"></a>00284 
<a name="l00285"></a>00285 
<a name="l00286"></a><a class="code" href="a00134.html#a8a88411ea52743d1d78ed68ed06e9507">00286</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00134.html#a8a88411ea52743d1d78ed68ed06e9507">Problem::writeElement</a>(<a class="code" href="a00189.html" title="Base class for writing XML formatted data to an output stream.">XMLOutput</a> *o, <span class="keyword">const</span> <a class="code" href="a00096.html" title="This class defines a keyword for the frePPLe data model.">Keyword</a>&amp; tag, <a class="code" href="a00257.html#a20c2c7e4c6b668e71c154ae3eb18f398">mode</a> m)<span class="keyword"> const</span>
<a name="l00287"></a>00287 <span class="keyword"></span>{
<a name="l00288"></a>00288   <span class="comment">// We ignore the mode, and always write the complete model</span>
<a name="l00289"></a>00289   o-&gt;<a class="code" href="a00189.html#a5c1811dae2e3eae344ad366f6441a8a5">BeginObject</a>(tag);
<a name="l00290"></a>00290   o-&gt;<a class="code" href="a00189.html#a711922eea4cfe3c33b97e4188dacc7d2">writeElement</a>(<a class="code" href="a00177.html#aeb3841a93774dfc303e3df16304b5af2">Tags::tag_name</a>, <a class="code" href="a00134.html#a8a73cf77f0bed3a807e65f9844d9baf4">getType</a>().type);
<a name="l00291"></a>00291   o-&gt;<a class="code" href="a00189.html#a711922eea4cfe3c33b97e4188dacc7d2">writeElement</a>(<a class="code" href="a00177.html#a6ae79e34440e259269ed2f902cd47157">Tags::tag_description</a>, <a class="code" href="a00134.html#a37253df6ba9ebdbea97e9f789dfb8bb2">getDescription</a>());
<a name="l00292"></a>00292   o-&gt;<a class="code" href="a00189.html#a711922eea4cfe3c33b97e4188dacc7d2">writeElement</a>(<a class="code" href="a00177.html#ae9fda65e25c8720724e21b35138deec0">Tags::tag_start</a>, <a class="code" href="a00134.html#af283f4815d85c0b33d112efe4435737b">getDates</a>().getStart());
<a name="l00293"></a>00293   o-&gt;<a class="code" href="a00189.html#a711922eea4cfe3c33b97e4188dacc7d2">writeElement</a>(<a class="code" href="a00177.html#ae7b833aedeada2860688b90cb947cdb2">Tags::tag_end</a>, <a class="code" href="a00134.html#af283f4815d85c0b33d112efe4435737b">getDates</a>().getEnd());
<a name="l00294"></a>00294   o-&gt;<a class="code" href="a00189.html#a711922eea4cfe3c33b97e4188dacc7d2">writeElement</a>(<a class="code" href="a00177.html#a322eeb623ca6fea00c5ad9f6026ba54c">Tags::tag_weight</a>, <a class="code" href="a00134.html#aeac2c097edda9dee786247f8cd69bb4b">getWeight</a>());
<a name="l00295"></a>00295   o-&gt;<a class="code" href="a00189.html#a05375aa593bb0514020b035411c8983c">EndObject</a>(tag);
<a name="l00296"></a>00296 }
<a name="l00297"></a>00297 
<a name="l00298"></a>00298 
<a name="l00299"></a><a class="code" href="a00056.html#aee5bf25575ea4467b8fca012977efe74">00299</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00056.html#aee5bf25575ea4467b8fca012977efe74">HasProblems::EntityIterator::EntityIterator</a>() : type(0)
<a name="l00300"></a>00300 {
<a name="l00301"></a>00301   <span class="comment">// Buffer</span>
<a name="l00302"></a>00302   <a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a> = <span class="keyword">new</span> Buffer::iterator(<a class="code" href="a00085.html#a1926a798edd9c04bc37e596936003cd6">Buffer::begin</a>());
<a name="l00303"></a>00303   <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a> != <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Buffer::end</a>()) <span class="keywordflow">return</span>;
<a name="l00304"></a>00304 
<a name="l00305"></a>00305   <span class="comment">// Move on to resource if there are no buffers</span>
<a name="l00306"></a>00306   <span class="keyword">delete</span> <a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a>;
<a name="l00307"></a>00307   type = 1;
<a name="l00308"></a>00308   <a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a> = <span class="keyword">new</span> Resource::iterator(<a class="code" href="a00085.html#a1926a798edd9c04bc37e596936003cd6">Resource::begin</a>());
<a name="l00309"></a>00309   <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a> != <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Resource::end</a>()) <span class="keywordflow">return</span>;
<a name="l00310"></a>00310 
<a name="l00311"></a>00311   <span class="comment">// Move on to operationplans if there are no resources either</span>
<a name="l00312"></a>00312   <span class="keyword">delete</span> <a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a>;
<a name="l00313"></a>00313   type = 2;
<a name="l00314"></a>00314   <a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a> = <span class="keyword">new</span> <a class="code" href="a00093.html" title="This class models an STL-like iterator that allows us to iterate over the operationplans...">OperationPlan::iterator</a>(<a class="code" href="a00125.html#a8bd5449992e056b2d637cfe65ac7da1f">OperationPlan::begin</a>());
<a name="l00315"></a>00315   <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a> != <a class="code" href="a00125.html#a0f9f6ba7d4fe7e20e9b88c765fe24f25">OperationPlan::end</a>()) <span class="keywordflow">return</span>;
<a name="l00316"></a>00316 
<a name="l00317"></a>00317   <span class="comment">// Move on to demands if there are no operationplans either</span>
<a name="l00318"></a>00318   <span class="keyword">delete</span> <a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a>;
<a name="l00319"></a>00319   type = 3;
<a name="l00320"></a>00320   <a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a> = <span class="keyword">new</span> Demand::iterator(<a class="code" href="a00085.html#a1926a798edd9c04bc37e596936003cd6">Demand::begin</a>());
<a name="l00321"></a>00321   <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a> == <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Demand::end</a>())
<a name="l00322"></a>00322   {
<a name="l00323"></a>00323     <span class="comment">// There is nothing at all in this model</span>
<a name="l00324"></a>00324     <span class="keyword">delete</span> <a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a>;
<a name="l00325"></a>00325     type = 4;
<a name="l00326"></a>00326   }
<a name="l00327"></a>00327 }
<a name="l00328"></a>00328 
<a name="l00329"></a>00329 
<a name="l00330"></a><a class="code" href="a00056.html#af3ebf5231383d03efc2f43b2761e829e">00330</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">HasProblems::EntityIterator</a>&amp; <a class="code" href="a00056.html#af3ebf5231383d03efc2f43b2761e829e">HasProblems::EntityIterator::operator++</a>()
<a name="l00331"></a>00331 {
<a name="l00332"></a>00332   <span class="keywordflow">switch</span> (type)
<a name="l00333"></a>00333   {
<a name="l00334"></a>00334     <span class="keywordflow">case</span> 0:
<a name="l00335"></a>00335       <span class="comment">// Buffer</span>
<a name="l00336"></a>00336       <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a> != <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Buffer::end</a>())
<a name="l00337"></a>00337         <span class="keywordflow">if</span> (++(*<a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a>) != <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Buffer::end</a>()) <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00338"></a>00338       ++type;
<a name="l00339"></a>00339       <span class="keyword">delete</span> <a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a>;
<a name="l00340"></a>00340       <a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a> = <span class="keyword">new</span> Resource::iterator(<a class="code" href="a00085.html#a1926a798edd9c04bc37e596936003cd6">Resource::begin</a>());
<a name="l00341"></a>00341       <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a> != <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Resource::end</a>()) <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00342"></a>00342       <span class="comment">// Note: no break statement</span>
<a name="l00343"></a>00343     <span class="keywordflow">case</span> 1:
<a name="l00344"></a>00344       <span class="comment">// Resource</span>
<a name="l00345"></a>00345       <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a> != <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Resource::end</a>())
<a name="l00346"></a>00346         <span class="keywordflow">if</span> (++(*<a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a>) != <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Resource::end</a>()) <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00347"></a>00347       ++type;
<a name="l00348"></a>00348       <span class="keyword">delete</span> <a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a>;
<a name="l00349"></a>00349       <a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a> = <span class="keyword">new</span> <a class="code" href="a00093.html" title="This class models an STL-like iterator that allows us to iterate over the operationplans...">OperationPlan::iterator</a>(<a class="code" href="a00125.html#a8bd5449992e056b2d637cfe65ac7da1f">OperationPlan::begin</a>());
<a name="l00350"></a>00350       <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a> != <a class="code" href="a00125.html#a0f9f6ba7d4fe7e20e9b88c765fe24f25">OperationPlan::end</a>()) <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00351"></a>00351       <span class="comment">// Note: no break statement</span>
<a name="l00352"></a>00352     <span class="keywordflow">case</span> 2:
<a name="l00353"></a>00353       <span class="comment">// Operationplan</span>
<a name="l00354"></a>00354       <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a> != <a class="code" href="a00125.html#a0f9f6ba7d4fe7e20e9b88c765fe24f25">OperationPlan::end</a>())
<a name="l00355"></a>00355         <span class="keywordflow">if</span> (++(*<a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a>) != <a class="code" href="a00125.html#a0f9f6ba7d4fe7e20e9b88c765fe24f25">OperationPlan::end</a>()) <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00356"></a>00356       ++type;
<a name="l00357"></a>00357       <span class="keyword">delete</span> <a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a>;
<a name="l00358"></a>00358       <a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a> = <span class="keyword">new</span> Demand::iterator(<a class="code" href="a00085.html#a1926a798edd9c04bc37e596936003cd6">Demand::begin</a>());
<a name="l00359"></a>00359       <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a> != <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Demand::end</a>()) <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00360"></a>00360       <span class="comment">// Note: no break statement</span>
<a name="l00361"></a>00361     <span class="keywordflow">case</span> 3:
<a name="l00362"></a>00362       <span class="comment">// Demand</span>
<a name="l00363"></a>00363       <span class="keywordflow">if</span> (*<a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a> != <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Demand::end</a>())
<a name="l00364"></a>00364         <span class="keywordflow">if</span> (++(*<a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a>) != <a class="code" href="a00085.html#abb9d04973550ac71037718511358f2ff">Demand::end</a>()) <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00365"></a>00365       <span class="comment">// Ended recursing of all entities</span>
<a name="l00366"></a>00366       ++type;
<a name="l00367"></a>00367       <span class="keyword">delete</span> <a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a>;
<a name="l00368"></a>00368       <a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a> = NULL;
<a name="l00369"></a>00369       <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00370"></a>00370   }
<a name="l00371"></a>00371   <span class="keywordflow">throw</span> <a class="code" href="a00111.html" title="An exception of this type is thrown when the library gets in an inconsistent state...">LogicException</a>(<span class="stringliteral">&quot;Unreachable code reached&quot;</span>);
<a name="l00372"></a>00372 }
<a name="l00373"></a>00373 
<a name="l00374"></a>00374 
<a name="l00375"></a><a class="code" href="a00056.html#a782d3c68339976756be7ce2d90bd0b9f">00375</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00056.html#a782d3c68339976756be7ce2d90bd0b9f">HasProblems::EntityIterator::~EntityIterator</a>()
<a name="l00376"></a>00376 {
<a name="l00377"></a>00377   <span class="keywordflow">switch</span> (type)
<a name="l00378"></a>00378   {
<a name="l00379"></a>00379     <span class="comment">// Buffer</span>
<a name="l00380"></a>00380     <span class="keywordflow">case</span> 0: <span class="keyword">delete</span> <a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a>; <span class="keywordflow">return</span>;
<a name="l00381"></a>00381     <span class="comment">// Resource</span>
<a name="l00382"></a>00382     <span class="keywordflow">case</span> 1: <span class="keyword">delete</span> <a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a>; <span class="keywordflow">return</span>;
<a name="l00383"></a>00383     <span class="comment">// Operation</span>
<a name="l00384"></a>00384     <span class="keywordflow">case</span> 2: <span class="keyword">delete</span> <a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a>; <span class="keywordflow">return</span>;
<a name="l00385"></a>00385     <span class="comment">// Demand</span>
<a name="l00386"></a>00386     <span class="keywordflow">case</span> 3: <span class="keyword">delete</span> <a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a>; <span class="keywordflow">return</span>;
<a name="l00387"></a>00387   }
<a name="l00388"></a>00388 }
<a name="l00389"></a>00389 
<a name="l00390"></a>00390 
<a name="l00391"></a><a class="code" href="a00056.html#a1d1e7bdf73cd9c207ea62bd40d5e6de9">00391</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00056.html#aee5bf25575ea4467b8fca012977efe74">HasProblems::EntityIterator::EntityIterator</a>(<span class="keyword">const</span> <a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">EntityIterator</a>&amp; o)
<a name="l00392"></a>00392 {
<a name="l00393"></a>00393   <span class="comment">// Delete old iterator</span>
<a name="l00394"></a>00394   this-&gt;<a class="code" href="a00056.html#a782d3c68339976756be7ce2d90bd0b9f">~EntityIterator</a>();
<a name="l00395"></a>00395   <span class="comment">// Populate new values</span>
<a name="l00396"></a>00396   type = o.type;
<a name="l00397"></a>00397   <span class="keywordflow">if</span> (type==0) <a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a> = <span class="keyword">new</span> Buffer::iterator(*(o.<a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a>));
<a name="l00398"></a>00398   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (type==1) <a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a> = <span class="keyword">new</span> Resource::iterator(*(o.<a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a>));
<a name="l00399"></a>00399   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (type==2) <a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a> = <span class="keyword">new</span> <a class="code" href="a00093.html" title="This class models an STL-like iterator that allows us to iterate over the operationplans...">OperationPlan::iterator</a>(*(o.<a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a>));
<a name="l00400"></a>00400   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (type==3) <a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a> = <span class="keyword">new</span> Demand::iterator(*(o.<a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a>));
<a name="l00401"></a>00401 }
<a name="l00402"></a>00402 
<a name="l00403"></a>00403 
<a name="l00404"></a>00404 <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">HasProblems::EntityIterator</a>&amp;
<a name="l00405"></a><a class="code" href="a00056.html#a8abc5dbf622789a78da5534319600e71">00405</a> <a class="code" href="a00056.html#a8abc5dbf622789a78da5534319600e71">HasProblems::EntityIterator::operator=</a>(<span class="keyword">const</span> <a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">EntityIterator</a>&amp; o)
<a name="l00406"></a>00406 {
<a name="l00407"></a>00407   <span class="comment">// Gracefully handle self assignment</span>
<a name="l00408"></a>00408   <span class="keywordflow">if</span> (<span class="keyword">this</span> == &amp;o) <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00409"></a>00409   <span class="comment">// Delete old iterator</span>
<a name="l00410"></a>00410   this-&gt;<a class="code" href="a00056.html#a782d3c68339976756be7ce2d90bd0b9f">~EntityIterator</a>();
<a name="l00411"></a>00411   <span class="comment">// Populate new values</span>
<a name="l00412"></a>00412   type = o.type;
<a name="l00413"></a>00413   <span class="keywordflow">if</span> (type==0) <a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a> = <span class="keyword">new</span> Buffer::iterator(*(o.<a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a>));
<a name="l00414"></a>00414   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (type==1) <a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a> = <span class="keyword">new</span> Resource::iterator(*(o.<a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a>));
<a name="l00415"></a>00415   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (type==2) <a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a> = <span class="keyword">new</span> <a class="code" href="a00093.html" title="This class models an STL-like iterator that allows us to iterate over the operationplans...">OperationPlan::iterator</a>(*(o.<a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a>));
<a name="l00416"></a>00416   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (type==3) <a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a> = <span class="keyword">new</span> Demand::iterator(*(o.<a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a>));
<a name="l00417"></a>00417   <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00418"></a>00418 }
<a name="l00419"></a>00419 
<a name="l00420"></a>00420 
<a name="l00421"></a>00421 <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">bool</span>
<a name="l00422"></a><a class="code" href="a00056.html#a77576e15c0276d0dd493d0364750a1cf">00422</a> <a class="code" href="a00056.html#a77576e15c0276d0dd493d0364750a1cf">HasProblems::EntityIterator::operator != </a>(<span class="keyword">const</span> <a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">EntityIterator</a>&amp; t)<span class="keyword"> const</span>
<a name="l00423"></a>00423 <span class="keyword"></span>{
<a name="l00424"></a>00424   <span class="comment">// Different iterator type, thus always different and return false</span>
<a name="l00425"></a>00425   <span class="keywordflow">if</span> (type != t.type) <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00426"></a>00426 
<a name="l00427"></a>00427   <span class="comment">// Same iterator type, more granular comparison required</span>
<a name="l00428"></a>00428   <span class="keywordflow">switch</span> (type)
<a name="l00429"></a>00429   {
<a name="l00430"></a>00430     <span class="comment">// Buffer</span>
<a name="l00431"></a>00431     <span class="keywordflow">case</span> 0: <span class="keywordflow">return</span> *<a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a> != *(t.<a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a>);
<a name="l00432"></a>00432     <span class="comment">// Resource</span>
<a name="l00433"></a>00433     <span class="keywordflow">case</span> 1: <span class="keywordflow">return</span> *<a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a> != *(t.<a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a>);
<a name="l00434"></a>00434     <span class="comment">// Operationplan</span>
<a name="l00435"></a>00435     <span class="keywordflow">case</span> 2: <span class="keywordflow">return</span> *<a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a> != *(t.<a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a>);
<a name="l00436"></a>00436     <span class="comment">// Demand</span>
<a name="l00437"></a>00437     <span class="keywordflow">case</span> 3: <span class="keywordflow">return</span> *<a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a> != *(t.<a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a>);
<a name="l00438"></a>00438     <span class="comment">// Always return true for higher type numbers. This should happen only</span>
<a name="l00439"></a>00439     <span class="comment">// when comparing with the end of list element.</span>
<a name="l00440"></a>00440     <span class="keywordflow">default</span>: <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00441"></a>00441   }
<a name="l00442"></a>00442 }
<a name="l00443"></a>00443 
<a name="l00444"></a>00444 
<a name="l00445"></a><a class="code" href="a00056.html#abc3c506e82b8e5f33544fd951381f8c4">00445</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00086.html" title="Classes that keep track of problem conditions need to implement this class.">HasProblems</a>&amp; <a class="code" href="a00056.html#abc3c506e82b8e5f33544fd951381f8c4">HasProblems::EntityIterator::operator*</a>()<span class="keyword"> const</span>
<a name="l00446"></a>00446 <span class="keyword"></span>{
<a name="l00447"></a>00447   <span class="keywordflow">switch</span> (type)
<a name="l00448"></a>00448   {
<a name="l00449"></a>00449     <span class="comment">// Buffer</span>
<a name="l00450"></a>00450     <span class="keywordflow">case</span> 0: <span class="keywordflow">return</span> **<a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a>;
<a name="l00451"></a>00451     <span class="comment">// Resource</span>
<a name="l00452"></a>00452     <span class="keywordflow">case</span> 1: <span class="keywordflow">return</span> **<a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a>;
<a name="l00453"></a>00453     <span class="comment">// Operation</span>
<a name="l00454"></a>00454     <span class="keywordflow">case</span> 2: <span class="keywordflow">return</span> **<a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a>;
<a name="l00455"></a>00455     <span class="comment">// Demand</span>
<a name="l00456"></a>00456     <span class="keywordflow">case</span> 3: <span class="keywordflow">return</span> **<a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a>;
<a name="l00457"></a>00457     <span class="keywordflow">default</span>: <span class="keywordflow">throw</span> <a class="code" href="a00111.html" title="An exception of this type is thrown when the library gets in an inconsistent state...">LogicException</a>(<span class="stringliteral">&quot;Unreachable code reached&quot;</span>);
<a name="l00458"></a>00458   }
<a name="l00459"></a>00459 }
<a name="l00460"></a>00460 
<a name="l00461"></a>00461 
<a name="l00462"></a><a class="code" href="a00056.html#a1af071099a2082c3dcf1dc34cf4645b2">00462</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00086.html" title="Classes that keep track of problem conditions need to implement this class.">HasProblems</a>* <a class="code" href="a00056.html#a1af071099a2082c3dcf1dc34cf4645b2">HasProblems::EntityIterator::operator-&gt;</a>()<span class="keyword"> const</span>
<a name="l00463"></a>00463 <span class="keyword"></span>{
<a name="l00464"></a>00464   <span class="keywordflow">switch</span> (type)
<a name="l00465"></a>00465   {
<a name="l00466"></a>00466     <span class="comment">// Buffer</span>
<a name="l00467"></a>00467     <span class="keywordflow">case</span> 0: <span class="keywordflow">return</span> &amp;**<a class="code" href="a00056.html#afe3b44e3ad002a67dd865afb500b143b">bufIter</a>;
<a name="l00468"></a>00468     <span class="comment">// Resource</span>
<a name="l00469"></a>00469     <span class="keywordflow">case</span> 1: <span class="keywordflow">return</span> &amp;**<a class="code" href="a00056.html#a4ba4fdbade858b32331a47d5ef1dab44">resIter</a>;
<a name="l00470"></a>00470     <span class="comment">// Operationplan</span>
<a name="l00471"></a>00471     <span class="keywordflow">case</span> 2: <span class="keywordflow">return</span> &amp;**<a class="code" href="a00056.html#a3f45c215512b5212392b9202c81b6a57">operIter</a>;
<a name="l00472"></a>00472     <span class="comment">// Demand</span>
<a name="l00473"></a>00473     <span class="keywordflow">case</span> 3: <span class="keywordflow">return</span> &amp;**<a class="code" href="a00056.html#a0338ec67f197f4c9a73cfa4b6f0e4643">demIter</a>;
<a name="l00474"></a>00474     <span class="keywordflow">default</span>: <span class="keywordflow">throw</span> <a class="code" href="a00111.html" title="An exception of this type is thrown when the library gets in an inconsistent state...">LogicException</a>(<span class="stringliteral">&quot;Unreachable code reached&quot;</span>);
<a name="l00475"></a>00475   }
<a name="l00476"></a>00476 }
<a name="l00477"></a>00477 
<a name="l00478"></a>00478 
<a name="l00479"></a><a class="code" href="a00086.html#adcb3e4396766daeac438fa874e0b92a8">00479</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">HasProblems::EntityIterator</a> <a class="code" href="a00086.html#adcb3e4396766daeac438fa874e0b92a8">HasProblems::beginEntity</a>()
<a name="l00480"></a>00480 {
<a name="l00481"></a>00481   <span class="keywordflow">return</span> <a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">EntityIterator</a>();
<a name="l00482"></a>00482 }
<a name="l00483"></a>00483 
<a name="l00484"></a>00484 
<a name="l00485"></a><a class="code" href="a00086.html#a6ac8107c2f5208d4cdf46f20c3b41228">00485</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">HasProblems::EntityIterator</a> <a class="code" href="a00086.html#a6ac8107c2f5208d4cdf46f20c3b41228">HasProblems::endEntity</a>()
<a name="l00486"></a>00486 {
<a name="l00487"></a>00487   <span class="comment">// Note that we give call a constructor with type 4, in order to allow</span>
<a name="l00488"></a>00488   <span class="comment">// a fast comparison.</span>
<a name="l00489"></a>00489   <span class="keywordflow">return</span> <a class="code" href="a00056.html" title="This class models a iterator that walks over all available HasProblem entities.">EntityIterator</a>(4);
<a name="l00490"></a>00490 }
<a name="l00491"></a>00491 
<a name="l00492"></a>00492 
<a name="l00493"></a><a class="code" href="a00039.html#ab31d6402106b61baaefbe494f3bc927d">00493</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00039.html" title="This class models an STL-like iterator that allows us to iterate over the named entities...">Problem::const_iterator</a>&amp; <a class="code" href="a00039.html#ab31d6402106b61baaefbe494f3bc927d">Problem::const_iterator::operator++</a>()
<a name="l00494"></a>00494 {
<a name="l00495"></a>00495   <span class="comment">// Incrementing beyond the end</span>
<a name="l00496"></a>00496   <span class="keywordflow">if</span> (!iter) <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00497"></a>00497 
<a name="l00498"></a>00498   <span class="comment">// Move to the next problem</span>
<a name="l00499"></a>00499   iter = iter-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>;
<a name="l00500"></a>00500 
<a name="l00501"></a>00501   <span class="comment">// Move to the next entity</span>
<a name="l00502"></a>00502   <span class="comment">// We need a while loop here because some entities can be without problems</span>
<a name="l00503"></a>00503   <span class="keywordflow">while</span> (!iter &amp;&amp; !owner &amp;&amp; eiter!=<a class="code" href="a00086.html#a6ac8107c2f5208d4cdf46f20c3b41228">HasProblems::endEntity</a>())
<a name="l00504"></a>00504   {
<a name="l00505"></a>00505     ++eiter;
<a name="l00506"></a>00506     <span class="keywordflow">if</span> (eiter!=<a class="code" href="a00086.html#a6ac8107c2f5208d4cdf46f20c3b41228">HasProblems::endEntity</a>()) iter = eiter-&gt;firstProblem;
<a name="l00507"></a>00507   }
<a name="l00508"></a>00508   <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00509"></a>00509 }
<a name="l00510"></a>00510 
<a name="l00511"></a>00511 
<a name="l00512"></a><a class="code" href="a00134.html#a1532b2bb7078ebcd527a8bf332ffb861">00512</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00039.html" title="This class models an STL-like iterator that allows us to iterate over the named entities...">Problem::const_iterator</a> <a class="code" href="a00134.html#a1532b2bb7078ebcd527a8bf332ffb861">Problem::begin</a>()
<a name="l00513"></a>00513 {
<a name="l00514"></a>00514   <a class="code" href="a00133.html#a53bdeef1e395514631372ae74b596b2a">Plannable::computeProblems</a>();
<a name="l00515"></a>00515   <span class="keywordflow">return</span> <a class="code" href="a00134.html#ac220ce1c155db1ac44146c12d178056f">const_iterator</a>();
<a name="l00516"></a>00516 }
<a name="l00517"></a>00517 
<a name="l00518"></a>00518 
<a name="l00519"></a><a class="code" href="a00134.html#a71c75d34039d739b3949aab50637d1a4">00519</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00039.html" title="This class models an STL-like iterator that allows us to iterate over the named entities...">Problem::const_iterator</a> <a class="code" href="a00134.html#a1532b2bb7078ebcd527a8bf332ffb861">Problem::begin</a>(<a class="code" href="a00086.html" title="Classes that keep track of problem conditions need to implement this class.">HasProblems</a>* i, <span class="keywordtype">bool</span> refresh)
<a name="l00520"></a>00520 {
<a name="l00521"></a>00521   <span class="comment">// Null pointer passed, loop through the full list anyway</span>
<a name="l00522"></a>00522   <span class="keywordflow">if</span> (!i) <span class="keywordflow">return</span> <a class="code" href="a00134.html#a1532b2bb7078ebcd527a8bf332ffb861">begin</a>();
<a name="l00523"></a>00523 
<a name="l00524"></a>00524   <span class="comment">// Return an iterator for a single entity</span>
<a name="l00525"></a>00525   <span class="keywordflow">if</span> (refresh) i-&gt;<a class="code" href="a00086.html#aaa5a254f9a1c7aab3d423de333185b87">updateProblems</a>();
<a name="l00526"></a>00526   <span class="keywordflow">return</span> <a class="code" href="a00134.html#ac220ce1c155db1ac44146c12d178056f">const_iterator</a>(i);
<a name="l00527"></a>00527 }
<a name="l00528"></a>00528 
<a name="l00529"></a>00529 
<a name="l00530"></a><a class="code" href="a00134.html#ae3fc9d1129b3e956ac2c9ec6c54035d8">00530</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keyword">const</span> <a class="code" href="a00039.html" title="This class models an STL-like iterator that allows us to iterate over the named entities...">Problem::const_iterator</a> <a class="code" href="a00134.html#ae3fc9d1129b3e956ac2c9ec6c54035d8">Problem::end</a>()
<a name="l00531"></a>00531 {
<a name="l00532"></a>00532   <span class="keywordflow">return</span> <a class="code" href="a00134.html#ac220ce1c155db1ac44146c12d178056f">const_iterator</a>(static_cast&lt;Problem*&gt;(NULL));
<a name="l00533"></a>00533 }
<a name="l00534"></a>00534 
<a name="l00535"></a>00535 
<a name="l00536"></a><a class="code" href="a00134.html#a0e4d549feb1341e3e0a24a6dc554ee4a">00536</a> PyObject* <a class="code" href="a00134.html#a0e4d549feb1341e3e0a24a6dc554ee4a">Problem::getattro</a>(<span class="keyword">const</span> <a class="code" href="a00002.html" title="A class to model keyword instances.">Attribute</a>&amp; attr)
<a name="l00537"></a>00537 {
<a name="l00538"></a>00538   <span class="keywordflow">if</span> (attr.<a class="code" href="a00002.html#aebffce6c4fcf1696ca34f63f2b6ee091">isA</a>(<a class="code" href="a00177.html#aeb3841a93774dfc303e3df16304b5af2">Tags::tag_name</a>))
<a name="l00539"></a>00539     <span class="keywordflow">return</span> <a class="code" href="a00154.html" title="This class handles two-way translation between the data types in C++ and Python.">PythonObject</a>(<a class="code" href="a00134.html#a8a73cf77f0bed3a807e65f9844d9baf4">getType</a>().<a class="code" href="a00115.html#a1c94d25992dd871a1eee6825ab84d28a">type</a>);
<a name="l00540"></a>00540   <span class="keywordflow">if</span> (attr.<a class="code" href="a00002.html#aebffce6c4fcf1696ca34f63f2b6ee091">isA</a>(<a class="code" href="a00177.html#a6ae79e34440e259269ed2f902cd47157">Tags::tag_description</a>))
<a name="l00541"></a>00541     <span class="keywordflow">return</span> <a class="code" href="a00154.html" title="This class handles two-way translation between the data types in C++ and Python.">PythonObject</a>(<a class="code" href="a00134.html#a37253df6ba9ebdbea97e9f789dfb8bb2">getDescription</a>());
<a name="l00542"></a>00542   <span class="keywordflow">if</span> (attr.<a class="code" href="a00002.html#aebffce6c4fcf1696ca34f63f2b6ee091">isA</a>(<a class="code" href="a00177.html#a2ec024c18bb9567812e9ca12cd87c801">Tags::tag_entity</a>))
<a name="l00543"></a>00543     <span class="keywordflow">return</span> <a class="code" href="a00154.html" title="This class handles two-way translation between the data types in C++ and Python.">PythonObject</a>(<a class="code" href="a00134.html#a393e211b1d4da9fbc4cb1b1284248c1b">getEntity</a>());
<a name="l00544"></a>00544   <span class="keywordflow">if</span> (attr.<a class="code" href="a00002.html#aebffce6c4fcf1696ca34f63f2b6ee091">isA</a>(<a class="code" href="a00177.html#ae9fda65e25c8720724e21b35138deec0">Tags::tag_start</a>))
<a name="l00545"></a>00545     <span class="keywordflow">return</span> <a class="code" href="a00154.html" title="This class handles two-way translation between the data types in C++ and Python.">PythonObject</a>(<a class="code" href="a00134.html#af283f4815d85c0b33d112efe4435737b">getDates</a>().<a class="code" href="a00050.html#a73e574de7fbf5df8ebc4c5190e7d49c3">getStart</a>());
<a name="l00546"></a>00546   <span class="keywordflow">if</span> (attr.<a class="code" href="a00002.html#aebffce6c4fcf1696ca34f63f2b6ee091">isA</a>(<a class="code" href="a00177.html#ae7b833aedeada2860688b90cb947cdb2">Tags::tag_end</a>))
<a name="l00547"></a>00547     <span class="keywordflow">return</span> <a class="code" href="a00154.html" title="This class handles two-way translation between the data types in C++ and Python.">PythonObject</a>(<a class="code" href="a00134.html#af283f4815d85c0b33d112efe4435737b">getDates</a>().<a class="code" href="a00050.html#a165a8f748d8468e5ba8331c0e06bd3a2">getEnd</a>());
<a name="l00548"></a>00548   <span class="keywordflow">if</span> (attr.<a class="code" href="a00002.html#aebffce6c4fcf1696ca34f63f2b6ee091">isA</a>(<a class="code" href="a00177.html#a322eeb623ca6fea00c5ad9f6026ba54c">Tags::tag_weight</a>))
<a name="l00549"></a>00549     <span class="keywordflow">return</span> <a class="code" href="a00154.html" title="This class handles two-way translation between the data types in C++ and Python.">PythonObject</a>(<a class="code" href="a00134.html#aeac2c097edda9dee786247f8cd69bb4b">getWeight</a>());
<a name="l00550"></a>00550   <span class="keywordflow">if</span> (attr.<a class="code" href="a00002.html#aebffce6c4fcf1696ca34f63f2b6ee091">isA</a>(<a class="code" href="a00177.html#aaa2f978792ac2320979871ceafdc5c16">Tags::tag_owner</a>))
<a name="l00551"></a>00551     <span class="keywordflow">return</span> <a class="code" href="a00154.html" title="This class handles two-way translation between the data types in C++ and Python.">PythonObject</a>(<a class="code" href="a00134.html#a66e1a9cb011d009afffb32f428c06fdf">getOwner</a>());
<a name="l00552"></a>00552   <span class="keywordflow">return</span> NULL;
<a name="l00553"></a>00553 }
<a name="l00554"></a>00554 
<a name="l00555"></a>00555 
<a name="l00556"></a><a class="code" href="a00100.html#a620fa94f33970c5b337dd0e2365e9ab6">00556</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00100.html#a620fa94f33970c5b337dd0e2365e9ab6">Problem::List::clear</a>(<a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *c) 
<a name="l00557"></a>00557 {
<a name="l00558"></a>00558   <span class="comment">// Unchain the predecessor</span>
<a name="l00559"></a>00559   <span class="keywordflow">if</span> (c)
<a name="l00560"></a>00560   {
<a name="l00561"></a>00561     <span class="keywordflow">for</span> (<a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *x = first; x; x = x-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>)
<a name="l00562"></a>00562       <span class="keywordflow">if</span> (x-&gt;nextProblem == c)
<a name="l00563"></a>00563       {
<a name="l00564"></a>00564         x-&gt;nextProblem = NULL;
<a name="l00565"></a>00565         <span class="keywordflow">break</span>;
<a name="l00566"></a>00566       }
<a name="l00567"></a>00567   }
<a name="l00568"></a>00568 
<a name="l00569"></a>00569   <span class="comment">// Delete each constraint in the list</span>
<a name="l00570"></a>00570   <span class="keywordflow">for</span> (<a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *cur = c ? c : first; cur; )
<a name="l00571"></a>00571   {
<a name="l00572"></a>00572     <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *del = cur;
<a name="l00573"></a>00573     cur = cur-&gt;nextProblem;
<a name="l00574"></a>00574     del-&gt;<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a> = NULL;
<a name="l00575"></a>00575     <span class="keyword">delete</span> del;
<a name="l00576"></a>00576   }
<a name="l00577"></a>00577 
<a name="l00578"></a>00578   <span class="comment">// Set the header to NULL</span>
<a name="l00579"></a>00579   <span class="keywordflow">if</span> (!c) first = NULL;
<a name="l00580"></a>00580 }
<a name="l00581"></a>00581 
<a name="l00582"></a>00582 
<a name="l00583"></a><a class="code" href="a00100.html#add9d396135451bf2efef6527cea7839a">00583</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a>* <a class="code" href="a00100.html#add9d396135451bf2efef6527cea7839a">Problem::List::push</a>(<span class="keyword">const</span> <a class="code" href="a00115.html" title="This class stores metadata about the classes in the library. The stored information...">MetaClass</a>* m, 
<a name="l00584"></a>00584   <span class="keyword">const</span> <a class="code" href="a00120.html" title="Object is the abstract base class for the main entities.">Object</a>* o, <a class="code" href="a00049.html" title="This class represents a date and time with an accuracy of one second.">Date</a> st, <a class="code" href="a00049.html" title="This class represents a date and time with an accuracy of one second.">Date</a> nd, <span class="keywordtype">double</span> w)
<a name="l00585"></a>00585 {
<a name="l00586"></a>00586   <span class="comment">// Find the end of the list</span>
<a name="l00587"></a>00587   <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a>* cur = first;
<a name="l00588"></a>00588   <span class="keywordflow">while</span> (cur &amp;&amp; cur-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a> &amp;&amp; cur-&gt;<a class="code" href="a00134.html#a66e1a9cb011d009afffb32f428c06fdf">getOwner</a>() != o)
<a name="l00589"></a>00589     cur = cur-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>;
<a name="l00590"></a>00590   if (cur &amp;&amp; cur-&gt;<a class="code" href="a00134.html#a66e1a9cb011d009afffb32f428c06fdf">getOwner</a>() == o)
<a name="l00591"></a>00591     <span class="comment">// Duplicate problem: stop here.</span>
<a name="l00592"></a>00592     <span class="keywordflow">return</span> cur; 
<a name="l00593"></a>00593 
<a name="l00594"></a>00594   <span class="comment">// Create a new problem</span>
<a name="l00595"></a>00595   <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *p;
<a name="l00596"></a>00596   <span class="keywordflow">if</span> (m == <a class="code" href="a00137.html#ae943a0ede255ced55bc8ac355c50fff6">ProblemCapacityOverload::metadata</a>)
<a name="l00597"></a>00597     p = <span class="keyword">new</span> <a class="code" href="a00137.html" title="A problem of this class is created when a resource is being overloaded during a certain...">ProblemCapacityOverload</a>(const_cast&lt;Resource*&gt;(dynamic_cast&lt;const Resource*&gt;(o)), st, nd, w, <span class="keyword">false</span>);
<a name="l00598"></a>00598   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (m == <a class="code" href="a00146.html#aabbcfbf928d9353d5be6097a1d05942c">ProblemMaterialShortage::metadata</a>)
<a name="l00599"></a>00599     p = <span class="keyword">new</span> <a class="code" href="a00146.html" title="A problem of this class is created when a buffer is having a material shortage during...">ProblemMaterialShortage</a>(const_cast&lt;Buffer*&gt;(dynamic_cast&lt;const Buffer*&gt;(o)), st, nd, w, <span class="keyword">false</span>);
<a name="l00600"></a>00600   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (m == <a class="code" href="a00135.html#aa55a9bf686195db07c0fa8723c2479f2">ProblemBeforeCurrent::metadata</a>)
<a name="l00601"></a>00601     p = <span class="keyword">new</span> <a class="code" href="a00135.html" title="A problem of this class is created when an operationplan is being planned in the...">ProblemBeforeCurrent</a>(const_cast&lt;Operation*&gt;(dynamic_cast&lt;const Operation*&gt;(o)), st, nd, w);
<a name="l00602"></a>00602   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (m == <a class="code" href="a00136.html#abd86b7cbefa986340a2b6d80c9aeab17">ProblemBeforeFence::metadata</a>)
<a name="l00603"></a>00603     p = <span class="keyword">new</span> <a class="code" href="a00136.html" title="A problem of this class is created when an operationplan is being planned before...">ProblemBeforeFence</a>(const_cast&lt;Operation*&gt;(dynamic_cast&lt;const Operation*&gt;(o)), st, nd, w);
<a name="l00604"></a>00604   <span class="keywordflow">else</span>
<a name="l00605"></a>00605     <span class="keywordflow">throw</span> <a class="code" href="a00111.html" title="An exception of this type is thrown when the library gets in an inconsistent state...">LogicException</a>(<span class="stringliteral">&quot;Problem factory can&apos;t create this type of problem&quot;</span>);
<a name="l00606"></a>00606 
<a name="l00607"></a>00607   <span class="comment">// Link the problem in the list</span>
<a name="l00608"></a>00608   <span class="keywordflow">if</span> (cur)
<a name="l00609"></a>00609     cur-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a> = p;
<a name="l00610"></a>00610   <span class="keywordflow">else</span>
<a name="l00611"></a>00611     first = p;
<a name="l00612"></a>00612   <span class="keywordflow">return</span> p;
<a name="l00613"></a>00613 }
<a name="l00614"></a>00614 
<a name="l00615"></a>00615 
<a name="l00616"></a><a class="code" href="a00100.html#ad00f9532f9f1aa1f744e7ac6ceccdfac">00616</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <span class="keywordtype">void</span> <a class="code" href="a00100.html#ad00f9532f9f1aa1f744e7ac6ceccdfac">Problem::List::pop</a>(<a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *p) 
<a name="l00617"></a>00617 {
<a name="l00618"></a>00618   <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *q = NULL; 
<a name="l00619"></a>00619   <span class="keywordflow">if</span> (p)
<a name="l00620"></a>00620   {
<a name="l00621"></a>00621     <span class="comment">// Skip the problem that was passed as argument</span>
<a name="l00622"></a>00622     q = p-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>;
<a name="l00623"></a>00623     p-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a> = NULL;
<a name="l00624"></a>00624   }
<a name="l00625"></a>00625   <span class="keywordflow">else</span>
<a name="l00626"></a>00626   {
<a name="l00627"></a>00627     <span class="comment">// NULL argument: delete all</span>
<a name="l00628"></a>00628     q = first;
<a name="l00629"></a>00629     first = NULL;
<a name="l00630"></a>00630   }
<a name="l00631"></a>00631 
<a name="l00632"></a>00632   <span class="comment">// Delete each constraint after the marked one</span>
<a name="l00633"></a>00633   <span class="keywordflow">while</span> (q)
<a name="l00634"></a>00634   {
<a name="l00635"></a>00635     <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *del = q;
<a name="l00636"></a>00636     q = q-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>;
<a name="l00637"></a>00637     del-&gt;<a class="code" href="a00134.html#a1f4c26a4eff13faa79d88287beb204c2">owner</a> = NULL;
<a name="l00638"></a>00638     <span class="keyword">delete</span> del;
<a name="l00639"></a>00639   }
<a name="l00640"></a>00640 }
<a name="l00641"></a>00641 
<a name="l00642"></a>00642 
<a name="l00643"></a><a class="code" href="a00100.html#a0391e63b3596b7820946776182f7bd7f">00643</a> <a class="code" href="a00252.html#a99b94ab8c2f2a32277559c7b2b0a054c">DECLARE_EXPORT</a> <a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a>* <a class="code" href="a00100.html#a0391e63b3596b7820946776182f7bd7f">Problem::List::top</a>()<span class="keyword"> const</span>
<a name="l00644"></a>00644 <span class="keyword"></span>{
<a name="l00645"></a>00645   <span class="keywordflow">for</span> (<a class="code" href="a00134.html" title="A problem represents infeasibilities, alerts and warnings in the plan.">Problem</a> *p = first; p; p = p-&gt;<a class="code" href="a00134.html#ad638c0a23c7a37fa2b3e0463d837e1e0">nextProblem</a>)
<a name="l00646"></a>00646     <span class="keywordflow">if</span> (!p-&gt;nextProblem) <span class="keywordflow">return</span> p;
<a name="l00647"></a>00647   <span class="keywordflow">return</span> NULL;
<a name="l00648"></a>00648 }
<a name="l00649"></a>00649 
<a name="l00650"></a>00650 
<a name="l00651"></a>00651 } <span class="comment">// End namespace</span>
</pre></div></div>
<hr size="1"/><address style="align: right;"><small>Documentation generated for frePPLe by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"/></a></small></address>
</div>
</div>
</body>
</html>