X-Git-Url: https://ruin.nu/git/?p=germs.git;a=blobdiff_plain;f=src%2Freverseaction.h;h=d69af75b16f96e2f76728cb80efd88ecf933325f;hp=006c9eb4de9df4446b27ccaee6da4068d435a4a2;hb=efe42ca948704593c847996d0ae8da71d15bb75b;hpb=f8575ea6c0982bba5ccf42771b2994d19500c0a3 diff --git a/src/reverseaction.h b/src/reverseaction.h index 006c9eb..d69af75 100644 --- a/src/reverseaction.h +++ b/src/reverseaction.h @@ -23,6 +23,7 @@ #include "sortaction.h" #include "genealgorithms.h" +#include "geneorder.h" #include #include @@ -32,15 +33,16 @@ * * \author Michael Andreen */ -class ReverseAction : public SortAction{ +class ReverseAction : public SortActionImpl{ public: /** * Creates a new reverse action for the interval [i,j] */ - ReverseAction(size_t i, size_t j): SortAction(0),_i(i),_j(j){ + ReverseAction(size_t i, size_t j): _i(i),_j(j){ } - ReverseAction(Interval i): SortAction(0){ + + ReverseAction(Interval i){ _i = std::min(i.first,i.second); _j = std::max(i.first,i.second)-1; } @@ -53,7 +55,7 @@ class ReverseAction : public SortAction{ return go; } - virtual bool operator==(const SortAction& sa) const{ + virtual bool operator==(const SortActionImpl& sa) const{ if (const ReverseAction* psa = dynamic_cast(&sa)){ if (_i == psa->_i && _j == psa->_j) return true;