Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / src / mc / explo / odpor / WakeupTreeIterator.hpp
index 8d65829..e42184c 100644 (file)
 
 namespace simgrid::mc::odpor {
 
-struct WakeupTreeIterator
+/**
+ * @brief A forward-iterator that performs a postorder traversal
+ * of the nodes of a WakeupTree
+ *
+ * Inserting a sequence `w` into a wakeup tree `B` with respect to
+ * some execution `E` requires determining the "<-minimal" node `N`
+ * with sequence `v` in the tree such that `v ~_[E] w`. The "<" relation
+ * over a wakeup tree orders its nodes by first recursively ordering all
+ * children of a node `N` followed by the node `N` itself, viz. a postorder.
+ * This iterator provides such a postorder traversal over the nodes in the
+ * wakeup tree.
+ */
+class WakeupTreeIterator
     : public boost::iterator_facade<WakeupTreeIterator, WakeupTreeNode*, boost::forward_traversal_tag> {
 public:
-  WakeupTreeIterator() = default;
+  // Use rule-of-three, and implicitely disable the move constructor which cannot be 'noexcept' (as required by C++ Core
+  // Guidelines), due to the std::list and std:stack<std::deque> members.
+  WakeupTreeIterator()                          = default;
+  WakeupTreeIterator(const WakeupTreeIterator&) = default;
+  ~WakeupTreeIterator()                         = default;
+
   explicit WakeupTreeIterator(const WakeupTree& tree);
 
 private: