Liquid XML Data Binder 2021
In This Topic
    AccountAdminRequest.cpp
    In This Topic
    /**********************************************************************************************
     * Copyright (c) 2001-2021 Liquid Technologies Limited. All rights reserved.
     * See www.liquid-technologies.com for product details.
     *
     * Please see products End User License Agreement for distribution permissions.
     *
     * WARNING: THIS FILE IS GENERATED
     * Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
     *
     * Generation  :  by Liquid XML Data Binder 17.0.1.9233
     * Using Schema: SimpleChoice.xsd
     **********************************************************************************************/
    #include "StdAfx.h" 
    #pragma warning (push) 
    #pragma warning (disable:4251)  // template export warning 
    #pragma warning (disable:4786)  // long debug names 
    #include "../SimpleChoiceLib.h" 
    #include "../SimpleChoiceLib/AccountAdminRequest.h" 
    
    // ##HAND_CODED_BLOCK_START ID="Additional Includes"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    // Add Additional Includes here...
    
    // ##HAND_CODED_BLOCK_END ID="Additional Includes"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    // Name                    : AccountAdminRequest
    // Long Name               : AccountAdminRequest
    // Element Name            : AccountAdminRequest
    // Class Namespace         : SimpleChoiceLib
    // Namespace Alias         : 
    // Schema Namespace        : 
    // Mapped Class Name       : CAccountAdminRequest
    // Mapped Class Full Name  : SimpleChoiceLib::CAccountAdminRequest
    // Mapped Class File Name  : CAccountAdminRequest
    // IsAbstract              : False
    // IsElement               : True
    // IsComplexType           : False
    
    namespace SimpleChoiceLib
    {
    
    LtXmlLib19Data::CParentElementInfo* CAccountAdminRequest::ms_pParentElementInfo = NULL;
    LtXmlLib19Data::CAttributeInfo** CAccountAdminRequest::ms_ppAttributeInfo = NULL;
    LtXmlLib19Data::CElementInfo** CAccountAdminRequest::ms_ppElementInfo = NULL;
    
    CAccountAdminRequestPtr CAccountAdminRequest::CreateInstance(LPCTSTR lpctElementName/*=_T("AccountAdminRequest")*/)
    {
        return new SimpleChoiceLib::CAccountAdminRequest(lpctElementName);
    }
    
    /*  
     * Constructor for CAccountAdminRequest
     *
     * The class is created with all the mandatory fields populated with the
     * default data.
     * All Collection objects are created.
     * However any 1-n relationships (these are represented as collections) are
     * empty. To comply with the schema these must be populated before the xml
     * obtained from ToXml is valid against the schema SimpleChoice.xsd
     */
    CAccountAdminRequest::CAccountAdminRequest(LPCTSTR lpctElementName/*=_T("AccountAdminRequest")*/)
     : CInstanceMonitor(_T("CAccountAdminRequest"))
    {
        m_elementName = lpctElementName;
        Init();
    }
    
    CAccountAdminRequest::~CAccountAdminRequest()
    {
        Cleanup();
    }
    
    void CAccountAdminRequest::Cleanup()
    {
        // unregister for any events we have asked for
        // cos there'll be no one left to hear soon
    }
    
    void CAccountAdminRequest::OnEvent(LtXmlLib19::CXmlObjectBase* pMsgSource, LtXmlLib19::IEventSink::MsgType eMsgType, void* pData)
    {
        if (eMsgType == LtXmlLib19::IEventSink::MT_CollectionChangeEvent)
        {
        }
    }
    
    /*
     * Initializes the class
     *
     * The Creates all the mandatory fields (populated with the default data) 
     * All Collection object are created.
     * However any 1-n relationships (these are represented as collections) are
     * empty. To comply with the schema these must be populated before the xml
     * obtained from ToXml is valid against the schema SimpleChoice.xsd.
     */
    void CAccountAdminRequest::Init()
    {
        Cleanup();
    
        this->m_CreateAccount = NULL;
        this->m_DeleteAccount = NULL;
        this->m_ChangeAccountPassword = NULL;
        
        m_validElement = _T("");
    
    
    // ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    // Add Additional Init Settings...
    
    // ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    }
        
    void CAccountAdminRequest::ClearChoice(LPCTSTR lpctSelectedElement)
    {
        this->m_CreateAccount = NULL;
        this->m_DeleteAccount = NULL;
        this->m_ChangeAccountPassword = NULL;
    
        m_validElement = lpctSelectedElement;
    }
    
    void CAccountAdminRequest::AccessProperty(int iPropertyIndex, bool bRead, LtXmlLib19::LtVariant& rValue)
    {
        if (bRead)
        {
            switch(iPropertyIndex)
            {
            case 1:
                    rValue.SetXmlObject(GetCreateAccount().Ptr());
                break;
            case 2:
                    rValue.SetXmlObject(GetDeleteAccount().Ptr());
                break;
            case 3:
                    rValue.SetXmlObject(GetChangeAccountPassword().Ptr());
                break;
            default:
                throw LtXmlLib19::CLtException(_T("Unknown Property Index"));
            };
        }
        else
        {
            switch(iPropertyIndex)
            {
            case 1:
                SetCreateAccount(dynamic_cast<SimpleChoiceLib::CCreateAccount*>(rValue.GetXmlObject().Ptr()));
                break;
            case 2:
                SetDeleteAccount(dynamic_cast<SimpleChoiceLib::CDeleteAccount*>(rValue.GetXmlObject().Ptr()));
                break;
            case 3:
                SetChangeAccountPassword(dynamic_cast<SimpleChoiceLib::CChangeAccountPassword*>(rValue.GetXmlObject().Ptr()));
                break;
            default:
                throw LtXmlLib19::CLtException(_T("Unknown Property Index"));
            }
        }
    }
    
    /*
     * Represents an optional Element in the XML document
     *
     * 
     * This property is represented as an Element in the XML.
     * It is optional, initially it is NULL.
     * Only one Element within this class may be set at a time, setting this property when another element is already set will raise an exception. setting this property to NULL will allow another element to be selected
     */
    SimpleChoiceLib::CCreateAccountPtr CAccountAdminRequest::GetCreateAccount() const
    { 
        return this->m_CreateAccount;  
    }
    void CAccountAdminRequest::SetCreateAccount(SimpleChoiceLib::CCreateAccount* value)
    { 
        // Ensure only on element is populated at a time
        ClearChoice(value == NULL?_T(""):_T("CreateAccount"));
        if (value == NULL)
            this->m_CreateAccount = NULL;
        else
        {
            SetElementName(value, _T("CreateAccount"));
            this->m_CreateAccount = value; 
        }
    }
    
    /*
     * Represents an optional Element in the XML document
     *
     * 
     * This property is represented as an Element in the XML.
     * It is optional, initially it is NULL.
     * Only one Element within this class may be set at a time, setting this property when another element is already set will raise an exception. setting this property to NULL will allow another element to be selected
     */
    SimpleChoiceLib::CDeleteAccountPtr CAccountAdminRequest::GetDeleteAccount() const
    { 
        return this->m_DeleteAccount;  
    }
    void CAccountAdminRequest::SetDeleteAccount(SimpleChoiceLib::CDeleteAccount* value)
    { 
        // Ensure only on element is populated at a time
        ClearChoice(value == NULL?_T(""):_T("DeleteAccount"));
        if (value == NULL)
            this->m_DeleteAccount = NULL;
        else
        {
            SetElementName(value, _T("DeleteAccount"));
            this->m_DeleteAccount = value; 
        }
    }
    
    /*
     * Represents an optional Element in the XML document
     *
     * 
     * This property is represented as an Element in the XML.
     * It is optional, initially it is NULL.
     * Only one Element within this class may be set at a time, setting this property when another element is already set will raise an exception. setting this property to NULL will allow another element to be selected
     */
    SimpleChoiceLib::CChangeAccountPasswordPtr CAccountAdminRequest::GetChangeAccountPassword() const
    { 
        return this->m_ChangeAccountPassword;  
    }
    void CAccountAdminRequest::SetChangeAccountPassword(SimpleChoiceLib::CChangeAccountPassword* value)
    { 
        // Ensure only on element is populated at a time
        ClearChoice(value == NULL?_T(""):_T("ChangeAccountPassword"));
        if (value == NULL)
            this->m_ChangeAccountPassword = NULL;
        else
        {
            SetElementName(value, _T("ChangeAccountPassword"));
            this->m_ChangeAccountPassword = value; 
        }
    }
    
    std::tstring CAccountAdminRequest::GetChoiceSelectedElement() const
    {
        return m_validElement; 
    }
    
    /*
     * Allows the class to be copied
     * Performs a 'deep copy' of all the data in the class (and its children)
     */
    SimpleChoiceLib::CAccountAdminRequestPtr CAccountAdminRequest::Clone() const
    {
        SimpleChoiceLib::CAccountAdminRequestPtr newObject = CreateInstance(m_elementName.c_str());
    
        int index = 0;
        newObject->m_CreateAccount = NULL;
        if (m_CreateAccount != NULL)
            newObject->m_CreateAccount = dynamic_cast<SimpleChoiceLib::CCreateAccount*>(m_CreateAccount->Clone().Ptr());
        newObject->m_DeleteAccount = NULL;
        if (m_DeleteAccount != NULL)
            newObject->m_DeleteAccount = dynamic_cast<SimpleChoiceLib::CDeleteAccount*>(m_DeleteAccount->Clone().Ptr());
        newObject->m_ChangeAccountPassword = NULL;
        if (m_ChangeAccountPassword != NULL)
            newObject->m_ChangeAccountPassword = dynamic_cast<SimpleChoiceLib::CChangeAccountPassword*>(m_ChangeAccountPassword->Clone().Ptr());
    
        newObject->m_validElement = m_validElement;
    
    // ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    // Add Additional clone code here...
    
    // ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
        return newObject.Ptr();
    }
    
    std::tstring CAccountAdminRequest::GetTargetNamespace() const
    {
        return _T("");
    }   
    
    std::tstring CAccountAdminRequest::GetNamespace() const
    {
        return _T("");
    }   
    
    LtXmlLib19::CXmlObjectBase* CAccountAdminRequest::GetBase()
    {
        return this;
    }   
    
    void CAccountAdminRequest::CleanMetaData()
    {
        LtXmlLib19::CXmlGeneratedClass::CleanMetaData(ms_pParentElementInfo, ms_ppElementInfo, ms_ppAttributeInfo);
    }
    
    LtXmlLib19Data::CParentElementInfo* CAccountAdminRequest::GetClassInfo() const
    {
        if (ms_pParentElementInfo == NULL)
        {
            m_csInit.Enter();
            if (ms_pParentElementInfo == NULL)
            {
                ms_pParentElementInfo = new LtXmlLib19Data::CParentElementInfo(
                                                                                LtXmlLib19Data::XmlElementGroupType_CHOICE,
                                                                                LtXmlLib19Data::XmlElementType_ELEMENT, 
                                                                                _T("AccountAdminRequest"),                   
                                                                                _T(""), 
                                                                                true,
                                                                                false,
                                                                                -1,
                                                                                LtXmlLib19::ItemType_none,
                                                                                NULL,
                                                                                false);
            }
            m_csInit.Leave();
        }
        
        return ms_pParentElementInfo;
    }
    
    LtXmlLib19Data::CElementInfo** CAccountAdminRequest::GetClassElementInfo() const
    {
        if (ms_ppElementInfo == NULL)
        {
            m_csInit.Enter();
            if (ms_ppElementInfo == NULL)
            {
                ms_ppElementInfo = new LtXmlLib19Data::CElementInfo*[4];
            
                ms_ppElementInfo[0] = new LtXmlLib19Data::CElementInfoChoiceClsOpt(_T("CreateAccount"), _T(""), 1, LtXmlLib19Data::XmlElementType_ELEMENT, (LtXmlLib19Data::pfnCreateClassDef)SimpleChoiceLib::CClassFactory::CreateClass, SimpleChoiceLib::CClassFactory::ClsName_CCreateAccount);
                ms_ppElementInfo[1] = new LtXmlLib19Data::CElementInfoChoiceClsOpt(_T("DeleteAccount"), _T(""), 2, LtXmlLib19Data::XmlElementType_ELEMENT, (LtXmlLib19Data::pfnCreateClassDef)SimpleChoiceLib::CClassFactory::CreateClass, SimpleChoiceLib::CClassFactory::ClsName_CDeleteAccount);
                ms_ppElementInfo[2] = new LtXmlLib19Data::CElementInfoChoiceClsOpt(_T("ChangeAccountPassword"), _T(""), 3, LtXmlLib19Data::XmlElementType_ELEMENT, (LtXmlLib19Data::pfnCreateClassDef)SimpleChoiceLib::CClassFactory::CreateClass, SimpleChoiceLib::CClassFactory::ClsName_CChangeAccountPassword);
                ms_ppElementInfo[3] = NULL;
            }
            m_csInit.Leave();
        }
        return ms_ppElementInfo;
    }
    
    LtXmlLib19Data::CAttributeInfo**    CAccountAdminRequest::GetClassAttributeInfo() const
    {
        if (ms_ppAttributeInfo == NULL)
        {
            m_csInit.Enter();
            if (ms_ppAttributeInfo == NULL)
            {
                ms_ppAttributeInfo = new LtXmlLib19Data::CAttributeInfo*[1];
                ms_ppAttributeInfo[0] = NULL;
            }
            m_csInit.Leave();
        }
        return ms_ppAttributeInfo;
    }
    
    // ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    // Add Additional Methods here...
    
    // ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    }; // namespace