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

	Program:		Range Imaging Toolkit (RITK)
	Module:			ritkGenericPayloadContainer.h
	Version:		$Revision: 898 $
	Date:			$Date: 2011-04-29 18:51:40 +0200 (Fri, 29 Apr 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 RITK_GENERICPAYLOADCONTAINER_H__
#define RITK_GENERICPAYLOADCONTAINER_H__

#include "ritkCommon.h"

#include <itkObjectFactory.h>
#include <itkDataObject.h>

namespace ritk
{

/**	@ingroup	Common
  *	@class		GenericPayloadContainer
  *	@author		Jakob Wasza
  *	@brief		Class that defines a generic RImage payload
  *
  *	@details
  */
class COMMON_EXPORT GenericPayloadContainer : public itk::DataObject
{
public:
	/** @name Standard typedefs */
	//@{
	typedef GenericPayloadContainer			Self;
	typedef itk::DataObject					Superclass;
	typedef itk::SmartPointer<Self>			Pointer;
	typedef itk::SmartPointer<const Self>	ConstPointer;
	//@}

	/// Typedefs for the payload. This enfores that the payload type has to be derived from itk::Object
	//@{
	typedef itk::DataObject					PayloadType;
	typedef PayloadType::Pointer			PayloadPointer;
	typedef PayloadType::ConstPointer		PayloadConstPointer;
	//@}


	/// Object creation
	itkNewMacro(Self);

	/// RTTI
	itkTypeMacro(GenericPayloadContainer, itk::Object);

	/**	@name Set/get the actual payload */
	//@{
	itkSetObjectMacro(Payload, PayloadType);
	itkGetObjectMacro(Payload, PayloadType);
	itkGetConstObjectMacro(Payload, PayloadType);
	//@}

	/**	@name Set/get the identifier for this payload */
	//@{
	itkSetMacro(Identifier, std::string&);
	itkGetConstMacro(Identifier, const std::string&);
	//@}

protected:
	/// Constructor
	GenericPayloadContainer();
	/// Destructor
	virtual ~GenericPayloadContainer();

	/// Print the object on a stream
	virtual void PrintSelf(std::ostream& os, itk::Indent indent) const;

protected:
	/// The actual payload
	PayloadPointer m_Payload;
	/// The identifer for the payload
	std::string m_Identifier;

private:
	/// purposely not implemented
	GenericPayloadContainer(Self&);

	/// purposely not implemented
	void operator=(const Self&); 
};


} // namespace ritk


#endif // RITK_GENERICPAYLOADCONTAINER_H__
