
#if !defined(CLockObject__INCLUDED_)
#define CLockObject__INCLUDED_

template<class TYPE>
class CLockObject
{
	CCriticalSection	m_scopeLock;

protected:
	TYPE	m_data;

public:
	void operator=(TYPE &other)
	{
		SCOPE_LOCK();
		m_data = other;
	}

	void operator=(TYPE other)
	{
		SCOPE_LOCK();
		m_data = other;
	}

	operator TYPE()
	{
		SCOPE_LOCK();
		return(m_data);
	}
};

#endif