In This Topic
#include "StdAfx.h"
#pragma warning (push)
#pragma warning (disable:4251)
#pragma warning (disable:4786)
#include "../SimpleHierarchyLib.h"
#include "../SimpleHierarchyLib/Vouchers.h"
namespace SimpleHierarchyLib
{
LtXmlLib20Data::CParentElementInfo* CVouchers::ms_pParentElementInfo = NULL;
LtXmlLib20Data::CAttributeInfo** CVouchers::ms_ppAttributeInfo = NULL;
LtXmlLib20Data::CElementInfo** CVouchers::ms_ppElementInfo = NULL;
CVouchersPtr CVouchers::CreateInstance(LPCTSTR lpctElementName)
{
return new SimpleHierarchyLib::CVouchers(lpctElementName);
}
CVouchers::CVouchers(LPCTSTR lpctElementName)
: CInstanceMonitor(_T("CVouchers"))
{
m_elementName = lpctElementName;
Init();
}
CVouchers::~CVouchers()
{
Cleanup();
}
void CVouchers::Cleanup()
{
// unregister for any events we have asked for
// cos there'll be no one left to hear soon
}
void CVouchers::OnEvent(LtXmlLib20::CXmlObjectBase* pMsgSource, LtXmlLib20::IEventSink::MsgType eMsgType, void* pData)
{
if (eMsgType == LtXmlLib20::IEventSink::MT_CollectionChangeEvent)
{
}
}
void CVouchers::Init()
{
Cleanup();
this->m_VoucherNo = 0;
this->m_VoucherValue = 0;
}
void CVouchers::AccessProperty(int iPropertyIndex, bool bRead, LtXmlLib20::LtVariant& rValue)
{
if (bRead)
{
switch(iPropertyIndex)
{
case 1:
rValue.SetUI8(GetVoucherNo());
break;
case 2:
rValue.SetUI8(GetVoucherValue());
break;
default:
throw LtXmlLib20::CLtException(_T("Unknown Property Index"));
};
}
else
{
switch(iPropertyIndex)
{
case 1:
SetVoucherNo(rValue.GetUI8());
break;
case 2:
SetVoucherValue(rValue.GetUI8());
break;
default:
throw LtXmlLib20::CLtException(_T("Unknown Property Index"));
}
}
}
DWORDLONG CVouchers::GetVoucherNo() const
{
return this->m_VoucherNo;
}
void CVouchers::SetVoucherNo(DWORDLONG value)
{
this->m_VoucherNo = value;
}
DWORDLONG CVouchers::GetVoucherValue() const
{
return this->m_VoucherValue;
}
void CVouchers::SetVoucherValue(DWORDLONG value)
{
this->m_VoucherValue = value;
}
SimpleHierarchyLib::CVouchersPtr CVouchers::Clone() const
{
SimpleHierarchyLib::CVouchersPtr newObject = CreateInstance(m_elementName.c_str());
int index = 0;
newObject->m_VoucherNo = m_VoucherNo;
newObject->m_VoucherValue = m_VoucherValue;
return newObject.Ptr();
}
std::tstring CVouchers::GetTargetNamespace() const
{
return _T("");
}
std::tstring CVouchers::GetNamespace() const
{
return _T("");
}
LtXmlLib20::CXmlObjectBase* CVouchers::GetBase()
{
return this;
}
void CVouchers::CleanMetaData()
{
LtXmlLib20::CXmlGeneratedClass::CleanMetaData(ms_pParentElementInfo, ms_ppElementInfo, ms_ppAttributeInfo);
}
LtXmlLib20Data::CParentElementInfo* CVouchers::GetClassInfo() const
{
if (ms_pParentElementInfo == NULL)
{
m_csInit.Enter();
if (ms_pParentElementInfo == NULL)
{
ms_pParentElementInfo = new LtXmlLib20Data::CParentElementInfo(
LtXmlLib20Data::XmlElementGroupType_SEQUENCE,
LtXmlLib20Data::XmlElementType_ELEMENT,
_T("Vouchers"),
_T(""),
true,
false,
-1,
LtXmlLib20::ItemType_none,
LtXmlLib20::CWhitespaceUtils::WhitespaceRule_None,
NULL,
false);
}
m_csInit.Leave();
}
return ms_pParentElementInfo;
}
LtXmlLib20Data::CElementInfo** CVouchers::GetClassElementInfo() const
{
if (ms_ppElementInfo == NULL)
{
m_csInit.Enter();
if (ms_ppElementInfo == NULL)
{
ms_ppElementInfo = new LtXmlLib20Data::CElementInfo*[1];
ms_ppElementInfo[0] = NULL;
}
m_csInit.Leave();
}
return ms_ppElementInfo;
}
LtXmlLib20Data::CAttributeInfo** CVouchers::GetClassAttributeInfo() const
{
if (ms_ppAttributeInfo == NULL)
{
m_csInit.Enter();
if (ms_ppAttributeInfo == NULL)
{
ms_ppAttributeInfo = new LtXmlLib20Data::CAttributeInfo*[3];
ms_ppAttributeInfo[0] = new LtXmlLib20Data::CAttributeInfoPrimitive(_T("VoucherNo"), _T(""), 1, false, LtXmlLib20::ItemType_ui8, NULL, LtXmlLib20::CWhitespaceUtils::WhitespaceRule_Collapse, LtXmlLib20::CPrimitiveRestrictions(_T(""), -1, -1, _T(""), _T(""), _T(""), _T(""), -1, -1, -1), NULL);
ms_ppAttributeInfo[1] = new LtXmlLib20Data::CAttributeInfoPrimitive(_T("VoucherValue"), _T(""), 2, false, LtXmlLib20::ItemType_ui8, NULL, LtXmlLib20::CWhitespaceUtils::WhitespaceRule_Collapse, LtXmlLib20::CPrimitiveRestrictions(_T(""), -1, -1, _T(""), _T(""), _T(""), _T(""), -1, -1, -1), NULL);
ms_ppAttributeInfo[2] = NULL;
}
m_csInit.Leave();
}
return ms_ppAttributeInfo;
}
};