Česky
Kamil Dudka

Fast SAT Solver (C++, GAlib)

File detail

Name:DownloadfssIO_8h-source.html [Download]
Location: fss > doc > api > html
Size:15.6 KB
Last modification:2022-09-09 13:06

Source code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Fast SAT Solver: fssIO.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.4 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</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>
  </ul>
</div>
<h1>fssIO.h</h1><a href="fssIO_8h.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"> * Copyright (C) 2008 Kamil Dudka &lt;xdudka00@stud.fit.vutbr.cz&gt;</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * This file is part of fss (Fast SAT Solver).</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * fss is free software: you can redistribute it and/or modify</span>
<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span>
<a name="l00009"></a>00009 <span class="comment"> * any later version.</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * fss is distributed in the hope that it will be useful,</span>
<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00015"></a>00015 <span class="comment"> *</span>
<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00017"></a>00017 <span class="comment"> * along with fss.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00018"></a>00018 <span class="comment"> */</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="preprocessor">#ifndef FSSIO_H</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define FSSIO_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="keyword">namespace </span>FastSatSolver {
<a name="l00035"></a>00035 
<a name="l00040"></a><a class="code" href="classFastSatSolver_1_1GenericException.html">00040</a>   <span class="keyword">class </span><a class="code" href="classFastSatSolver_1_1GenericException.html" title="Common-usage exception containing error message inside.">GenericException</a> {
<a name="l00041"></a>00041     <span class="keyword">public</span>:
<a name="l00045"></a>00045       <a class="code" href="classFastSatSolver_1_1GenericException.html#e96bc29d16844e4f75332be5565612da">GenericException</a>(std::string text);
<a name="l00046"></a>00046       
<a name="l00050"></a>00050       std::string <a class="code" href="classFastSatSolver_1_1GenericException.html#787a8b4145449843adff9e020d9a4ffb">getText</a>();
<a name="l00051"></a>00051 
<a name="l00052"></a>00052     <span class="keyword">private</span>:
<a name="l00053"></a>00053       std::string text_;
<a name="l00054"></a>00054   };
<a name="l00055"></a>00055 
<a name="l00061"></a>00061   <span class="keyword">namespace </span>StreamDecorator {
<a name="l00066"></a><a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1FixedFloat.html">00066</a>     <span class="keyword">class </span><a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1FixedFloat.html" title="High-level stream manipulator for fixed floats.">FixedFloat</a> {
<a name="l00067"></a>00067       <span class="keyword">public</span>:
<a name="l00072"></a>00072         <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1FixedFloat.html#c107cf92898cb0f3c2e6d70f50ef9978">FixedFloat</a>(<span class="keywordtype">int</span> integral, <span class="keywordtype">int</span> decimal);
<a name="l00073"></a>00073         <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1FixedFloat.html#57fcacc479c2091ce92da441b6b5d47a">~FixedFloat</a>();
<a name="l00074"></a>00074       <span class="keyword">private</span>:
<a name="l00075"></a>00075         <span class="keyword">struct </span><a class="code" href="structFastSatSolver_1_1StreamDecorator_1_1FixedFloat_1_1Private.html">Private</a>;
<a name="l00076"></a>00076         <a class="code" href="structFastSatSolver_1_1StreamDecorator_1_1FixedFloat_1_1Private.html">Private</a> *d;
<a name="l00077"></a>00077         <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1FixedFloat.html#0c2c51bf05815b9de5fa1ac961faa20d" title="This behaves as standard stream manipulators.">operator&lt;&lt; </a>(std::ostream &amp;stream, <span class="keyword">const</span> <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1FixedFloat.html" title="High-level stream manipulator for fixed floats.">FixedFloat</a> &amp;);
<a name="l00078"></a>00078     };
<a name="l00082"></a>00082     std::ostream&amp; <a class="code" href="namespaceFastSatSolver_1_1StreamDecorator.html#6efb3e1347278726e65bb1c54ff0f372" title="This behaves as standard stream manipulators.">operator&lt;&lt; </a>(std::ostream &amp;stream, <span class="keyword">const</span> <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1FixedFloat.html" title="High-level stream manipulator for fixed floats.">FixedFloat</a> &amp;);
<a name="l00083"></a>00083 
<a name="l00088"></a><a class="code" href="group__fssIO.html#gc31db05c6cb5891c704eae374f6926a8">00088</a>     <span class="keyword">enum</span> <a class="code" href="group__fssIO.html#gc31db05c6cb5891c704eae374f6926a8" title="Console ouput colors enumeration. Zero means default color.">EColor</a> {
<a name="l00089"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8867aff365e4363e987735e21638688ff">00089</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8867aff365e4363e987735e21638688ff">C_NO_COLOR</a> = 0,
<a name="l00090"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a874271441718d99651a8ef84ce41deb89">00090</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a874271441718d99651a8ef84ce41deb89">C_BLUE</a>,
<a name="l00091"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a83480f1b50ebb454abb68e97ef2fc7035">00091</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a83480f1b50ebb454abb68e97ef2fc7035">C_GREEN</a>,
<a name="l00092"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8c1114f9c564ec65461d5c72c16cbc397">00092</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8c1114f9c564ec65461d5c72c16cbc397">C_CYAN</a>,
<a name="l00093"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a87788537081e1a90985b102bdefa91992">00093</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a87788537081e1a90985b102bdefa91992">C_RED</a>,
<a name="l00094"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a847d1201016334a71f5539f40d7cff742">00094</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a847d1201016334a71f5539f40d7cff742">C_PURPLE</a>,
<a name="l00095"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a85356a1523faac7ca6377e5f466384aab">00095</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a85356a1523faac7ca6377e5f466384aab">C_BROWN</a>,
<a name="l00096"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8e1c164abe97ca5cd063cad0a33506481">00096</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8e1c164abe97ca5cd063cad0a33506481">C_LIGHT_GRAY</a>,
<a name="l00097"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a89ead34dfb566e79a6014eae6911fcd25">00097</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a89ead34dfb566e79a6014eae6911fcd25">C_DARK_GRAY</a>,
<a name="l00098"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8d627db49c0f44dcd2a17519757cabc6e">00098</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8d627db49c0f44dcd2a17519757cabc6e">C_LIGHT_BLUE</a>,
<a name="l00099"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8fc3053732b6f6c732f5c14c1bd272a83">00099</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8fc3053732b6f6c732f5c14c1bd272a83">C_LIGHT_GREEN</a>,
<a name="l00100"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a89229e25bd31e5a4083b92b2b2027c143">00100</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a89229e25bd31e5a4083b92b2b2027c143">C_LIGHT_CYAN</a>,
<a name="l00101"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a807e7345a77ef982f5566bd016f36566e">00101</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a807e7345a77ef982f5566bd016f36566e">C_LIGHT_RED</a>,
<a name="l00102"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8842bccb61643ddb9c3696fc5686b383a">00102</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8842bccb61643ddb9c3696fc5686b383a">C_LIGHT_PURPLE</a>,
<a name="l00103"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a816c62555d51f004c61508d482353064d">00103</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a816c62555d51f004c61508d482353064d">C_YELLOW</a>,
<a name="l00104"></a><a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8e1cdd4f64f0458efe9641f1eaca05218">00104</a>       <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8e1cdd4f64f0458efe9641f1eaca05218">C_WHITE</a>
<a name="l00105"></a>00105     };
<a name="l00106"></a>00106     
<a name="l00112"></a><a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html">00112</a>     <span class="keyword">class </span><a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html" title="Console output color manipulator.">Color</a> {
<a name="l00113"></a>00113       <span class="keyword">public</span>:
<a name="l00118"></a>00118         <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html#ad831a83ccd74cdc1781a68b1a20ae2d">Color</a>(<a class="code" href="group__fssIO.html#gc31db05c6cb5891c704eae374f6926a8" title="Console ouput colors enumeration. Zero means default color.">EColor</a> color = <a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a8867aff365e4363e987735e21638688ff">C_NO_COLOR</a>);
<a name="l00119"></a>00119         <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html#ad831a83ccd74cdc1781a68b1a20ae2d">Color</a>(<span class="keyword">const</span> <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html" title="Console output color manipulator.">Color</a> &amp;);
<a name="l00120"></a>00120         <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html#87ba96c77c896b3c568889338bf92444">~Color</a>();
<a name="l00125"></a>00125         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html#1adc5d528f0f1f25c32098debae06212" title="Enable/disable color ouput glaobally.">enable</a>(<span class="keywordtype">bool</span>);
<a name="l00129"></a>00129         <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html#56722b6f1c22da04885bc9853148bb71">isEnabled</a>();
<a name="l00130"></a>00130       <span class="keyword">private</span>:
<a name="l00131"></a>00131         <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html" title="Console output color manipulator.">Color</a>&amp; operator= (<span class="keyword">const</span> <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html" title="Console output color manipulator.">Color</a> &amp;);
<a name="l00132"></a>00132         <span class="keyword">static</span> <span class="keywordtype">bool</span> useColors;
<a name="l00133"></a>00133         <span class="keyword">struct </span><a class="code" href="structFastSatSolver_1_1StreamDecorator_1_1Color_1_1Private.html">Private</a>;
<a name="l00134"></a>00134         <a class="code" href="structFastSatSolver_1_1StreamDecorator_1_1Color_1_1Private.html">Private</a> *d;
<a name="l00135"></a>00135         <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html#bb88b174845d97427d946249ce75848f" title="This behaves as standard stream manipulators.">operator&lt;&lt; </a>(std::ostream &amp;, <span class="keyword">const</span> <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html" title="Console output color manipulator.">Color</a> &amp;);
<a name="l00136"></a>00136     };
<a name="l00140"></a>00140     std::ostream&amp; <a class="code" href="namespaceFastSatSolver_1_1StreamDecorator.html#6efb3e1347278726e65bb1c54ff0f372" title="This behaves as standard stream manipulators.">operator&lt;&lt; </a>(std::ostream &amp;, <span class="keyword">const</span> <a class="code" href="classFastSatSolver_1_1StreamDecorator_1_1Color.html" title="Console output color manipulator.">Color</a> &amp;);
<a name="l00141"></a>00141   } <span class="comment">// namespace StreamDecorator</span>
<a name="l00142"></a>00142 
<a name="l00148"></a><a class="code" href="group__fssIO.html#g7532fbb551a0335ad6c5964a0b9a0364">00148</a>   <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fssIO.html#g7532fbb551a0335ad6c5964a0b9a0364" title="Common routine for printing errors.">printError</a>(std::string szMsg) {
<a name="l00149"></a>00149     <span class="keyword">using namespace </span>StreamDecorator;
<a name="l00150"></a>00150     std::cerr &lt;&lt; Color(<a class="code" href="group__fssIO.html#ggc31db05c6cb5891c704eae374f6926a87788537081e1a90985b102bdefa91992">C_RED</a>) &lt;&lt; <span class="stringliteral">"!!! "</span> &lt;&lt; Color() &lt;&lt; szMsg &lt;&lt; std::endl;
<a name="l00151"></a>00151   }
<a name="l00152"></a>00152 
<a name="l00153"></a>00153 } <span class="comment">// namespace FastSatSolver</span>
<a name="l00154"></a>00154 
<a name="l00155"></a>00155 <span class="preprocessor">#endif // FSS_H</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Wed Nov 5 22:30:21 2008 for Fast SAT Solver by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address>
</body>
</html>