Skip to content

Commit

Permalink
deploy: d3a4f67
Browse files Browse the repository at this point in the history
  • Loading branch information
domire8 committed Oct 20, 2024
1 parent bddfb0b commit bf6f434
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
38 changes: 18 additions & 20 deletions versions/main/_predicate_8hpp_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,29 +93,27 @@
<div class="foldopen" id="foldopen00013" data-start="{" data-end="};">
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="classmodulo__core_1_1_predicate.html"> 13</a></span><span class="keyword">class </span><a class="code hl_class" href="classmodulo__core_1_1_predicate.html">Predicate</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classmodulo__core_1_1_predicate.html">Predicate</a>(<span class="keyword">const</span> std::function&lt;<span class="keywordtype">bool</span>(<span class="keywordtype">void</span>)&gt;&amp; predicate_function) : predicate_(std::move(predicate_function)) {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> previous_value_ = !predicate_();</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> }</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classmodulo__core_1_1_predicate.html">Predicate</a>(<span class="keyword">const</span> std::function&lt;<span class="keywordtype">bool</span>(<span class="keywordtype">void</span>)&gt;&amp; predicate_function) : predicate_(std::move(predicate_function)) {}</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordtype">bool</span> get_value()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> predicate_(); }</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">bool</span> get_value()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> predicate_(); }</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">void</span> set_predicate(<span class="keyword">const</span> std::function&lt;<span class="keywordtype">bool</span>(<span class="keywordtype">void</span>)&gt;&amp; predicate_function) { predicate_ = predicate_function; }</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordtype">void</span> set_predicate(<span class="keyword">const</span> std::function&lt;<span class="keywordtype">bool</span>(<span class="keywordtype">void</span>)&gt;&amp; predicate_function) { predicate_ = predicate_function; }</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> std::optional&lt;bool&gt; query() {</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">if</span> (<span class="keyword">const</span> <span class="keyword">auto</span> new_value = predicate_(); new_value != previous_value_) {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> previous_value_ = new_value;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">return</span> new_value;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> }</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">return</span> {};</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> }</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> std::function&lt;bool(<span class="keywordtype">void</span>)&gt; predicate_;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">bool</span> previous_value_;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span>};</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> std::optional&lt;bool&gt; query() {</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">if</span> (<span class="keyword">const</span> <span class="keyword">auto</span> new_value = predicate_(); !previous_value_ || new_value != *previous_value_) {</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> previous_value_ = new_value;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">return</span> new_value;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> }</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">return</span> {};</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> }</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> std::function&lt;bool(<span class="keywordtype">void</span>)&gt; predicate_;</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> std::optional&lt;bool&gt; previous_value_;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span>};</div>
</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span>}<span class="comment">// namespace modulo_core</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span>}<span class="comment">// namespace modulo_core</span></div>
<div class="ttc" id="aclassmodulo__core_1_1_predicate_html"><div class="ttname"><a href="classmodulo__core_1_1_predicate.html">modulo_core::Predicate</a></div><div class="ttdef"><b>Definition</b> <a href="_predicate_8hpp_source.html#l00013">Predicate.hpp:13</a></div></div>
<div class="ttc" id="anamespacemodulo__core_html"><div class="ttname"><a href="namespacemodulo__core.html">modulo_core</a></div><div class="ttdoc">Modulo Core.</div><div class="ttdef"><b>Definition</b> <a href="_message_pair_8hpp_source.html#l00010">MessagePair.hpp:10</a></div></div>
</div><!-- fragment --></div><!-- contents -->
Expand Down
6 changes: 3 additions & 3 deletions versions/main/classmodulo__core_1_1_predicate.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a6a951f3661dfc51ee304811b
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_predicate_8hpp_source.html#l00019">19</a> of file <a class="el" href="_predicate_8hpp_source.html">Predicate.hpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="_predicate_8hpp_source.html#l00017">17</a> of file <a class="el" href="_predicate_8hpp_source.html">Predicate.hpp</a>.</p>

</div>
</div>
Expand All @@ -174,7 +174,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#ab81f18c3c387426a124c5dc3
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_predicate_8hpp_source.html#l00023">23</a> of file <a class="el" href="_predicate_8hpp_source.html">Predicate.hpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="_predicate_8hpp_source.html#l00021">21</a> of file <a class="el" href="_predicate_8hpp_source.html">Predicate.hpp</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -202,7 +202,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a465cf99d14a8fe2fa773cdf6
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_predicate_8hpp_source.html#l00021">21</a> of file <a class="el" href="_predicate_8hpp_source.html">Predicate.hpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="_predicate_8hpp_source.html#l00019">19</a> of file <a class="el" href="_predicate_8hpp_source.html">Predicate.hpp</a>.</p>

</div>
</div>
Expand Down

0 comments on commit bf6f434

Please sign in to comment.