// file:          SearchlistGeneral.hpp
// description:   Combination of SearchspaceGeneral and OwnerOfList.
//                Sak A16(7)(b), Sak A1.
// author:        Karlheinz Hug
// creation date: 2012-06-20
// last update:   2012-07-02

#ifndef SEARCHLIST_GENERAL_HPP_
#define SEARCHLIST_GENERAL_HPP_

#include "SearchspaceGeneral.hpp"
#include "OwnerOfList.hpp"

	template <typename T>
	class SearchlistGeneral : public virtual SearchspaceGeneral<T>, protected OwnerOfList<T>
	{
		public:
			virtual void for_all_act (void (*act) (T x));
	}; // SearchlistGeneral

	template <typename T>
	void SearchlistGeneral<T>::for_all_act (void (*act) (T x))
	{
		typename OwnerOfList<T>::Node * pos = this->first;
		while (pos != this->last)
		{
			act(pos->item);
			pos = pos->next;
		}
	}

#endif // SEARCHLIST_GENERAL_HPP_
