/****************************************************************************************************

		BasicSmpThread.h
		Copyright: (c) 2001 Eovia Corp. All rights reserved.

		Author:	Arnaud
		Date:	10/16/2003

****************************************************************************************************/

#ifndef __BasicSmpThread__
#define __BasicSmpThread__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "IShSMP.h"
#include "MCSMPCountedObject.h"
#include "MCCountedPtrHelper.h"


/// \addtogroup BaseClass
/// \{

/// Basic SMP thread class.  Provides a default implementation of an ISMPThread. Derive from this so you only need to implement Work()
/// \see ISMPThread
class TBasicSmpThread : public ISMPThread, public TMCSMPCountedObject
{
protected:
	TBasicSmpThread	() {}
	~TBasicSmpThread	() {}
public:
	virtual MCCOMErr MCCOMAPI QueryInterface	(const MCIID& riid, void** ppvObj)
	{
		if (MCIsEqualIID(riid, IID_ISMPThread))
		{
			TMCCountedGetHelper<ISMPThread> result(ppvObj);
			result = this;
			return MC_S_OK;
		}
		return TMCSMPCountedObject::QueryInterface(riid, ppvObj);
	}

	virtual uint32 	 MCCOMAPI AddRef			()		{ return TMCSMPCountedObject::AddRef(); }
	virtual uint32 	 MCCOMAPI Release			()		{ return TMCSMPCountedObject::Release(); }
};


/// \}






#endif
