/*======================================================================================

	Program:		Range Imaging Toolkit (RITK)
	Module:			ritkImageTypePlugin.h
	Version:		$Revision: 1761 $
	Date:			$Date: 2011-09-23 17:25:41 +0200 (Fr, 23 Sep 2011) $

	Copyright (c) 2010-2011
	Pattern Recognition Lab, 
    University Erlangen-Nuremberg, Germany
    All rights reserved.

	This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
	See RITKCopyright.txt for more information.

	http://www5.informatik.uni-erlangen.de/research/software/ritk

========================================================================================*/

#ifndef IMAGETYPEPLUGIN_H__
#define IMAGETYPEPLUGIN_H__

#include "ritkRImageIOManager.h"
#include "ritkPluginBase.h"

namespace ritk
{

/**	@ingroup	Core
 *	@class		ImageTypePlugin
 *	@author		Jakob Wasza
 *	@brief		Class that provides the basic interface for image type plugins
 *
 *	@details
 *	This class provides the basic interface for image type plugins. The only task of such a plugin
 *	is to provide custom range images, if possible, independent from a certain SDK. 
 */
class CORE_EXPORT ImageTypePlugin : public PluginBase
{
public:
	/// Constructor
	ImageTypePlugin();
	/// Destructor
	virtual ~ImageTypePlugin();

	/**	@brief	Start the plugin
	 *	@param	p	Not used for image type plugins
	 *	@return	true on success, false otherwise
	 *
	 *	@details
	 *	Will start the plugin. The only action that is performed within this base class' implementation is 
	 *	to register the provided IO-pointer at the RImageIOManager. In most cases this should be sufficient 
	 *	and subclass do not need to override this method.
	 *	@sa GetIOObject()
	 */
	virtual bool StartPlugin(void *p=0);

	/**	@brief	Stop the plugin
	 *
	 *	@details
	 *	Will stop the plugin. The only action that is performed within this base class' implementation is
	 *	to unregister the provided IO-pointer from the RImageIOManager. In most cases this should be sufficient
	 *	and subclasses do not need to override this method.
	 *	@sa GetIOObject()
	 */
	virtual bool StopPlugin();

protected:
	/**	@brief	Return the IO-object for this image type
	 *	@return	the IO-object
	 *
	 *	@details
	 *	Calling this method has to return the proper IO-object for this image type. The method has to be provided
	 *	by all sub-classes and is eventually called during startup to register the IOObject and during shutdown
	 *	to unregister the IOObject
	 *	@sa StartPlugin()
	 *	@sa StopPlugin()
	 */
	virtual RImageIOManagerF2::RImageIOBaseType::Pointer GetIOObject()=0;
};

} // namespace ritk


#endif // IMAGETYPEPLUGIN_H__