// RsTemplateRenderData.cpp : Implementation of CRsTemplateRenderData

#include "stdafx.h"
#include "RsTemplateRenderData.h"


STDMETHODIMP CRsTemplateRenderData::SetNodeName(BSTR bszNodeName)
{
	m_bszNodeName = bszNodeName;
	return S_OK;
}

STDMETHODIMP CRsTemplateRenderData::GetNodeName(BSTR* pbszNodeName)
{
	return m_bszNodeName.CopyTo(pbszNodeName);
}


STDMETHODIMP CRsTemplateRenderData::AddConDescriptor(IRsConDescriptor* pConDesc)
{
	/*
	HRESULT hRes;

	CComQIPtr<IRsCloneable>	spCloneConDesc = pConDesc;
	if(spCloneConDesc == NULL)
		return E_NOINTERFACE;

	CComPtr<IRsObject>	spNewObject;
	if(FAILED(hRes = spCloneConDesc->Clone(&spNewObject)))
		return hRes;

	CComQIPtr<IRsConDescriptor>	spNewConDesc = spNewObject;
	if(spNewConDesc == NULL)
		return E_NOINTERFACE;

	m_aConDesc.Add(spNewConDesc);
	*/

	m_aConDesc.Add(pConDesc);
	return S_OK;
}

STDMETHODIMP CRsTemplateRenderData::GetConDescriptorAt(RtUlong ulPos, IRsConDescriptor** ppConDesc)
{
	if(ulPos > (RtUlong) m_aConDesc.GetCount())
		return E_INVALIDARG;

	CComPtr<IRsConDescriptor>	spConDesc = m_aConDesc.GetAt(ulPos);
	return spConDesc.CopyTo(ppConDesc);
}

STDMETHODIMP CRsTemplateRenderData::ConDescriptorCount(RtUlong* pulCount)
{
	*pulCount = (RtUlong) m_aConDesc.GetCount();
	return S_OK;
}