]> ruin.nu Git - germs.git/blobdiff - src/reverseaction.h
toString for actions
[germs.git] / src / reverseaction.h
index 76ab6660da377187420f268ce6dda84825ef3361..006c9eb4de9df4446b27ccaee6da4068d435a4a2 100644 (file)
@@ -25,6 +25,7 @@
 #include "genealgorithms.h"
 
 #include <algorithm>
+#include <sstream>
 
 /**
  * Reverses an interval
@@ -59,6 +60,15 @@ class ReverseAction : public SortAction{
                        }
                        return false;
                }
+
+               /**
+                * Gives a string representation of the action, for output
+                */
+               virtual std::string toString() const{
+                       std::ostringstream os;
+                       os << "[" << _i << "," << _j << "]";
+                       return os.str();
+               }
        private:
                size_t _i;
                size_t _j;