// header file:   CoderFactory.hpp
// description:   Module as class with a static factory function for coder objects.
//                Design pattern: Factory function.
// variant:       2 with flexible composition
// author:        Karlheinz Hug
// creation date: 2012-07-05
// last update:   2012-08-06

#ifndef CODER_FACTORY_HPP_
#define CODER_FACTORY_HPP_

#include <string>

#include "Coder.hpp"

	class CoderFactory
	{
		public:
			enum CoderType {copier, expander, caesar, vernam};

			static Coder * new_coder (Coder * const first, CoderType coder_type, const std::string & key);
				// Factory function for a coder described by 'first' and 'coder_type'.
				// If 'first' != 0, then it is combined with a coder described by 'coder_type'.
				// postcondition: return-value != 0
				// Caution! Function with a side-effect! Do not use in assertions!
	}; // CoderFactory

#endif // CODER_FACTORY_HPP_

