+ /**
+ * Creates a new sort action, given a specified action.
+ * SortAction promises to remove the given action.
+ */
+ SortAction(SortActionImpl* sa): _action(sa){
+ }
+
+ SortAction(const SortAction& sa): _action(sa._action){
+ }
+
+ const SortAction& operator=(const SortAction& sa){
+ if (this != &sa)
+ _action = sa._action;
+ return *this;
+ }
+
+ ~SortAction(){};
+
+ /**
+ * Applies the action on the GeneOrder and returning it.
+ */
+ GeneOrder& operator()(GeneOrder& go) const{
+ return (*_action)(go);
+ }
+
+ /**
+ * Compares sort actions.
+ */
+ bool operator==(const SortAction& sa) const{
+ return (*_action) == (*sa._action);
+ }
+
+ /**
+ * Compares sort actions.
+ */
+ bool operator==(const SortActionImpl& sa) const{
+ return (*_action) == sa;
+ }
+
+ /**
+ * Gives a string representation of the action, for output
+ */
+ std::string toString() const{
+ return _action->toString();
+ }