X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3959a22b008b3db13750b10bc76f24e4404155d2..4f76cb02e1d37e95f8e9a14fd4fc84f4b27f7661:/src/mc/explo/odpor/WakeupTree.hpp diff --git a/src/mc/explo/odpor/WakeupTree.hpp b/src/mc/explo/odpor/WakeupTree.hpp index 59b96c3f31..b4502f4951 100644 --- a/src/mc/explo/odpor/WakeupTree.hpp +++ b/src/mc/explo/odpor/WakeupTree.hpp @@ -35,8 +35,6 @@ namespace simgrid::mc::odpor { */ class WakeupTreeNode { private: - explicit WakeupTreeNode(std::shared_ptr u) : action_(u) {} - WakeupTreeNode* parent_ = nullptr; /** An ordered list of children of for this node in the tree */ @@ -53,6 +51,9 @@ private: friend WakeupTreeIterator; public: + explicit WakeupTreeNode(std::shared_ptr u) : action_(u) {} + + WakeupTreeNode() = default; ~WakeupTreeNode() = default; WakeupTreeNode(const WakeupTreeNode&) = delete; WakeupTreeNode(WakeupTreeNode&&) = default; @@ -71,6 +72,8 @@ public: std::shared_ptr get_action() const { return action_; } const std::list& get_ordered_children() const { return children_; } + std::string string_of_whole_tree(int indentation_level) const; + /** Insert a node `node` as a new child of this node */ void add_child(WakeupTreeNode* node); }; @@ -115,7 +118,7 @@ private: void insert_node(std::unique_ptr node); void insert_sequence_after(WakeupTreeNode* node, const PartialExecution& w); void remove_node(WakeupTreeNode* node); - bool contains(WakeupTreeNode* node) const; + bool contains(const WakeupTreeNode* node) const; /** * @brief Removes the node `root` and all of its descendants from @@ -151,6 +154,8 @@ public: std::vector get_single_process_texts() const; + std::string string_of_whole_tree() const; + /** * @brief Remove the subtree of the smallest (with respect * to the tree's "<" relation) single-process node.