X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/01ee0802dc993fc4f9e0c9e2e3babe352bf9df68..cc4e47adb7dcf6aa76c9e9c43f4ef0bc390684e6:/src/mc/explo/odpor/WakeupTree.hpp diff --git a/src/mc/explo/odpor/WakeupTree.hpp b/src/mc/explo/odpor/WakeupTree.hpp index 2a12641284..ea8cf2959a 100644 --- a/src/mc/explo/odpor/WakeupTree.hpp +++ b/src/mc/explo/odpor/WakeupTree.hpp @@ -49,10 +49,10 @@ public: WakeupTreeNode& operator=(const WakeupTreeNode&) = delete; WakeupTreeNode& operator=(WakeupTreeNode&&) = default; - const auto begin() const { return this->children_.begin(); } - const auto end() const { return this->children_.end(); } - const auto rbegin() const { return this->children_.rbegin(); } - const auto rend() const { return this->children_.rend(); } + auto begin() const { return this->children_.begin(); } + auto end() const { return this->children_.end(); } + auto rbegin() const { return this->children_.rbegin(); } + auto rend() const { return this->children_.rend(); } bool is_leaf() const { return children_.empty(); } bool is_root() const { return parent_ == nullptr; } @@ -190,6 +190,9 @@ public: */ std::optional get_min_single_process_node() const; + /** @brief Describes how a tree insertion was carried out */ + enum class InsertionResult { leaf, interior_node, root }; + /** * @brief Inserts an sequence `seq` of processes into the tree * such that that this tree is a wakeup tree relative to the @@ -214,8 +217,11 @@ public: * * @invariant: It is assumed that this tree is a wakeup tree * with respect to the given execution `E` + * + * @return Whether a sequence equivalent to `seq` is already contained + * as a leaf node in the tree */ - void insert(const Execution& E, const PartialExecution& seq); + InsertionResult insert(const Execution& E, const PartialExecution& seq); }; } // namespace simgrid::mc::odpor