<table><tr><td style="">fabiank created this revision.<br />Restricted Application added a reviewer: KDE Games.<br />Restricted Application added a subscriber: KDE Games.<br />fabiank requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D11815">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">make firstMoves and winMoves private members and add getter for them</li>
<li class="remarkup-list-item">replace mutex protected bool with atomic bool</li>
<li class="remarkup-list-item">do not directly expose m_shouldEnd, but provide a stopExecution function</li>
<li class="remarkup-list-item">use in-class initialization of member variables</li>
<li class="remarkup-list-item">remove debug variable, and the DEBUG_HINTS define which controlled it, use #ifndef NDEBUG to print the debug messages for now</li>
<li class="remarkup-list-item">Solver: use a unique_ptr for the MemoryManager</li>
</ul>

<p>Introduce a smaller SolverInterface, hiding the complexity of Solver</p>

<p>This change:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">extract all the publically used Solver functionality into SolverInterface, which consists only of virtual functions</li>
<li class="remarkup-list-item">move solverinterface into its own header, to minimize includes</li>
<li class="remarkup-list-item">converts users which used Solver directly to SolverInterface</li>
</ul>

<p>Convert Solver into a template, templated over the number of piles</p>

<p>The number of piles is known in each Solver subclass at compile time,<br />
thus a subclass with n piles does now inherit from Solver<n>.</p>

<p>m_number_piles and its setter become redundant with this change, and are<br />
removed</p>

<p>This enable the conversion of member variables which were<br />
dynamically allocated arrays into std::arrays, increasing type safety<br />
and causing an abort/exception on out-of-boundary access. Furthermore,<br />
the compiler can now better reason about some of the loops (though this<br />
doesn't really matter performance wise)</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Everything still compiles, and the Solver can still solve each game</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R410 KPatience</div></div></div><br /><div><strong>BRANCH</strong><div><div>solver_iface</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11815">https://phabricator.kde.org/D11815</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>dealer.cpp<br />
dealer.h<br />
gamestate.h<br />
main.cpp<br />
patsolve/clocksolver.cpp<br />
patsolve/clocksolver.h<br />
patsolve/fortyeightsolver.cpp<br />
patsolve/fortyeightsolver.h<br />
patsolve/freecellsolver.cpp<br />
patsolve/freecellsolver.h<br />
patsolve/golfsolver.cpp<br />
patsolve/golfsolver.h<br />
patsolve/grandfsolver.cpp<br />
patsolve/grandfsolver.h<br />
patsolve/gypsysolver.cpp<br />
patsolve/gypsysolver.h<br />
patsolve/idiotsolver.cpp<br />
patsolve/idiotsolver.h<br />
patsolve/klondikesolver.cpp<br />
patsolve/klondikesolver.h<br />
patsolve/mod3solver.cpp<br />
patsolve/mod3solver.h<br />
patsolve/patsolve.cpp<br />
patsolve/patsolve.h<br />
patsolve/simonsolver.cpp<br />
patsolve/simonsolver.h<br />
patsolve/solverinterface.h<br />
patsolve/spidersolver.cpp<br />
patsolve/spidersolver.h<br />
patsolve/yukonsolver.cpp<br />
patsolve/yukonsolver.h</div></div></div><br /><div><strong>To: </strong>fabiank, KDE Games<br /><strong>Cc: </strong>KDE Games<br /></div>