From bf6f434192200f36b070b126ad03a5d2bc7d0b2d Mon Sep 17 00:00:00 2001 From: domire8 Date: Sun, 20 Oct 2024 13:26:28 +0000 Subject: [PATCH] deploy: d3a4f6785b76d328adc3bbb5eb342ec85c902c25 --- versions/main/_predicate_8hpp_source.html | 38 +++++++++---------- .../main/classmodulo__core_1_1_predicate.html | 6 +-- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/versions/main/_predicate_8hpp_source.html b/versions/main/_predicate_8hpp_source.html index 1e0c649c..3a0239c7 100644 --- a/versions/main/_predicate_8hpp_source.html +++ b/versions/main/_predicate_8hpp_source.html @@ -93,29 +93,27 @@
13class Predicate {
14public:
-
15 explicit Predicate(const std::function<bool(void)>& predicate_function) : predicate_(std::move(predicate_function)) {
-
16 previous_value_ = !predicate_();
-
17 }
+
15 explicit Predicate(const std::function<bool(void)>& predicate_function) : predicate_(std::move(predicate_function)) {}
+
16
+
17 bool get_value() const { return predicate_(); }
18
-
19 bool get_value() const { return predicate_(); }
+
19 void set_predicate(const std::function<bool(void)>& predicate_function) { predicate_ = predicate_function; }
20
-
21 void set_predicate(const std::function<bool(void)>& predicate_function) { predicate_ = predicate_function; }
-
22
-
23 std::optional<bool> query() {
-
24 if (const auto new_value = predicate_(); new_value != previous_value_) {
-
25 previous_value_ = new_value;
-
26 return new_value;
-
27 }
-
28 return {};
-
29 }
-
30
-
31private:
-
32 std::function<bool(void)> predicate_;
-
33 bool previous_value_;
-
34};
+
21 std::optional<bool> query() {
+
22 if (const auto new_value = predicate_(); !previous_value_ || new_value != *previous_value_) {
+
23 previous_value_ = new_value;
+
24 return new_value;
+
25 }
+
26 return {};
+
27 }
+
28
+
29private:
+
30 std::function<bool(void)> predicate_;
+
31 std::optional<bool> previous_value_;
+
32};
-
35
-
36}// namespace modulo_core
+
33
+
34}// namespace modulo_core
Definition Predicate.hpp:13
Modulo Core.
diff --git a/versions/main/classmodulo__core_1_1_predicate.html b/versions/main/classmodulo__core_1_1_predicate.html index 5d533549..69ac9f45 100644 --- a/versions/main/classmodulo__core_1_1_predicate.html +++ b/versions/main/classmodulo__core_1_1_predicate.html @@ -147,7 +147,7 @@

-

Definition at line 19 of file Predicate.hpp.

+

Definition at line 17 of file Predicate.hpp.

@@ -174,7 +174,7 @@

-

Definition at line 23 of file Predicate.hpp.

+

Definition at line 21 of file Predicate.hpp.

@@ -202,7 +202,7 @@

-

Definition at line 21 of file Predicate.hpp.

+

Definition at line 19 of file Predicate.hpp.