/** @file irefcounted.h
*	virtual interface for abstract refcounted types
*	@author Chris Burns (cburns@ea.com)
*
*	EABaseTypes
*	(c) 2012 Electronic Arts Inc.
*/

#ifndef EABASETYPESPLUS_IREFCOUNTED_H_
#define EABASETYPESPLUS_IREFCOUNTED_H_

namespace EA
{
namespace Types
{
	/*! @class	IRefCounted irefcounted.h "EABaseTypesPlus/irefcounted.h"
	*	@brief	virtual interface for refcounted, deletable objects
	*/
	class IRefCounted
	{
	public:

		/*!
		*	virtual destructor
		*/
		virtual ~IRefCounted() {}

		/*!
		*	Add a reference to this object
		*	@return	int	The new reference count
		*/
		virtual int AddRef() = 0;

		/*!
		*	Release a reference to this object
		*	@return	int	The new reference count
		*/
		virtual int Release() = 0;

		/*!
		*	Get the current reference count
		*	@return	int	The current reference count
		*/
		virtual int GetRefCount() const = 0;

	protected:
		/*!
		*	Delete this object
		*/
		virtual void DeleteThis() = 0;
	};
}
}

#endif /* EABASETYPESPLUS_IREFCOUNTED_H_ */
