X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Fsortaction.h;h=66c337ca625cac468b113debc86c1cd224029a76;hb=6ed5c4682ee599c7d03d8c67dcca3ac4033a63ec;hp=d1a3f7bca68e3fe5a11c94631f117123c10295fe;hpb=3fff88637ec7e806f19e613051f31ca5178d2cf5;p=germs.git diff --git a/src/sortaction.h b/src/sortaction.h index d1a3f7b..66c337c 100644 --- a/src/sortaction.h +++ b/src/sortaction.h @@ -22,6 +22,7 @@ #define __SORTACTION_H__ #include +#include class GeneOrder; /** * Abstraction of a sort action, all child actions has to be immutable. @@ -38,6 +39,15 @@ class SortAction{ */ SortAction(SortAction* sa): _action(sa){ } + + SortAction(const SortAction& sa): _action(sa._action){ + } + + virtual const SortAction& operator=(const SortAction& sa){ + if (this != &sa) + _action = sa._action; + return *this; + } virtual ~SortAction(){}; @@ -54,6 +64,13 @@ class SortAction{ virtual bool operator==(const SortAction& sa) const{ return (*_action) == (sa._action.get() == 0 ? sa : *sa._action); } + + /** + * Gives a string representation of the action, for output + */ + virtual std::string toString() const{ + return _action->toString(); + } private: ActionPointer _action;