• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ XMLRegisterCleanup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中XMLRegisterCleanup的典型用法代码示例。如果您正苦于以下问题:C++ XMLRegisterCleanup类的具体用法?C++ XMLRegisterCleanup怎么用?C++ XMLRegisterCleanup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了XMLRegisterCleanup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: unregisterCleanup

// This function can be called either from XMLPlatformUtils::Terminate
// to state that the cleanup has been performed and should not be
// performed again, or from code that you have written that determines
// that cleanup is no longer necessary.
void XMLRegisterCleanup::unregisterCleanup()
{
    gXMLCleanupListMutex->lock();

    //
    // To protect against some compiler's (eg hp11) optimization
    // to change "this" as they update gXMLCleanupList
    //
    // refer to
    // void XMLPlatformUtils::Terminate()
    //       ...
    //       while (gXMLCleanupList)
    //            gXMLCleanupList->doCleanup();
    //

    XMLRegisterCleanup *tmpThis = (XMLRegisterCleanup*) this;

    // Unlink this object from the cleanup list
    if (m_nextCleanup) 
        m_nextCleanup->m_prevCleanup = m_prevCleanup;
		
    if (!m_prevCleanup) 
        gXMLCleanupList = m_nextCleanup;
    else 
        m_prevCleanup->m_nextCleanup = m_nextCleanup;

    gXMLCleanupListMutex->unlock();
		
    // Reset the object to the default state
    tmpThis->resetCleanup();

}
开发者ID:,项目名称:,代码行数:36,代码来源:


示例2:

//  getImplementation()  - Always returns the same singleton instance, which
//                         is lazily created on the first call.  Note that
//                         DOM_Implementation must be thread-safe because
//                         it is common to all DOM documents, and while a single
//                         document is not thread-safe within itself, we do
//                         promise that different documents can safely be
//                         used concurrently by different threads.
//
DOM_DOMImplementation &DOM_DOMImplementation::getImplementation() {
	static XMLRegisterCleanup implementationCleanup;

    if (gDomimp == 0)
    {
        DOM_DOMImplementation *t = new DOM_DOMImplementation;
        if (XMLPlatformUtils::compareAndSwap((void **)&gDomimp, t, 0) != 0)
        {
            delete t;
        }
        else
        {
			implementationCleanup.registerCleanup(reinitImplementation);
        }

    }
    return *gDomimp;
}
开发者ID:brock7,项目名称:TianLong,代码行数:26,代码来源:DOM_DOMImplementation.cpp


示例3:

// ---------------------------------------------------------------------------
//  XMLTransService: Constructors and destructor
// ---------------------------------------------------------------------------
XMLTransService::XMLTransService()
{
    if (!gMappings) {
        RefHashTableOf<ENameMap>* t = new RefHashTableOf<ENameMap>(103);

        if (XMLPlatformUtils::compareAndSwap((void **)&gMappings, t, 0) != 0)
        {
            delete t;
        }
        else
        {
            mappingsCleanup.registerCleanup(reinitMappings);
        }
    }

    if (!gMappingsRecognizer) {
        RefVectorOf<ENameMap>* t = new RefVectorOf<ENameMap>(XMLRecognizer::Encodings_Count);

        if (XMLPlatformUtils::compareAndSwap((void **)&gMappingsRecognizer, t, 0) != 0)
        {
            delete t;
        }
        else
        {
            mappingsRecognizerCleanup.registerCleanup(reinitMappingsRecognizer);
        }
    }
}
开发者ID:js422,项目名称:PERL,代码行数:31,代码来源:TransService.cpp


示例4: initializeXSDErrReporterMsgLoader

void XMLInitializer::initializeXSDErrReporterMsgLoader()
{
    gErrMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLErrDomain);
    if (gErrMsgLoader) {
        cleanupErrMsgLoader.registerCleanup(reinitErrMsgLoader);
    }

    gValidMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgValidityDomain);
    if (gValidMsgLoader) {
        cleanupValidMsgLoader.registerCleanup(reinitValidMsgLoader);
    }
}
开发者ID:brock7,项目名称:TianLong,代码行数:12,代码来源:XSDErrorReporter.cpp


示例5: initializeDOMImplementationRegistry

void XMLInitializer::initializeDOMImplementationRegistry()
{
    // mutex
    gDOMImplSrcVectorMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
    if (gDOMImplSrcVectorMutex) {
        cleanupDOMImplSrcVectorMutex.registerCleanup(reinitDOMImplSrcVectorMutex);
    }

    // vector
    gDOMImplSrcVector = new RefVectorOf<DOMImplementationSource>(3, false);
    if (gDOMImplSrcVector) {
        cleanupDOMImplSrcVector.registerCleanup(reinitDOMImplSrcVector);
    }
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:14,代码来源:DOMImplementationRegistry.cpp


示例6: mapElements

void GeneralAttributeCheck::mapElements()
{
    if (!sGeneralAttCheckMutexRegistered)
    {
        if (!sGeneralAttCheckMutex)
        {
            XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);

            if (!sGeneralAttCheckMutex)
                sGeneralAttCheckMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
        }

        // Use a faux scope to synchronize while we do this
        {
            XMLMutexLock lock(sGeneralAttCheckMutex);

            // If we got here first, then register it and set the registered flag
            if (!sGeneralAttCheckMutexRegistered)
            {
                // initialize
                setUpValidators();
                mapAttributes();

                // register for cleanup at Termination.
                sGeneralAttCheckCleanup.registerCleanup(GeneralAttributeCheck::reinitGeneralAttCheck);
                sGeneralAttCheckMutexRegistered = true;
            }
        }
    }
}
开发者ID:mydw,项目名称:mydw,代码行数:30,代码来源:GeneralAttributeCheck.cpp


示例7:

void XMLInitializer::initializeMsgLoader4DOM()
{
    sMsgLoader4DOM = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLDOMMsgDomain);
    if (sMsgLoader4DOM) {
        msgLoader4DOMCleanup.registerCleanup(reinitMsgLoader4DOM);
    }
}
开发者ID:ksmyth,项目名称:xerces-c,代码行数:7,代码来源:DOMImplementationImpl.cpp


示例8: initializeEmptyNodeList

void XMLInitializer::initializeEmptyNodeList()
{
    gEmptyNodeList = new DOMNodeListImpl(0);
    if (gEmptyNodeList) {
        emptyNodeListCleanup.registerCleanup(reinitEmptyNodeList);
    }
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:7,代码来源:DOMNodeImpl.cpp


示例9: lock

DOMNodeList *DOMNodeImpl::getChildNodes() const {

    if (!gEmptyNodeList)
    {
        if (!gEmptyNodeListMutex)
        {
            XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);
			
            if (!gEmptyNodeListMutex)
                gEmptyNodeListMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
        }

        // Use a faux scope to synchronize while we do this
        {
            XMLMutexLock lock(gEmptyNodeListMutex);

            if (!gEmptyNodeList)
            {
                gEmptyNodeList = new DOMNodeListImpl(0);
                emptyNodeListCleanup.registerCleanup(reinitEmptyNodeList);
            }
        }
    }

    return (DOMNodeList *)gEmptyNodeList;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:26,代码来源:DOMNodeImpl.cpp


示例10: initializeDOMImplementationImpl

void XMLInitializer::initializeDOMImplementationImpl()
{
    gDomimp = new DOMImplementationImpl;
    if (gDomimp) {
        implementationCleanup.registerCleanup(reinitImplementation);
    }
}
开发者ID:ksmyth,项目名称:xerces-c,代码行数:7,代码来源:DOMImplementationImpl.cpp


示例11: initializeEncodingValidator

void XMLInitializer::initializeEncodingValidator()
{
    EncodingValidator::fInstance = new EncodingValidator();
    if (EncodingValidator::fInstance) {
        instanceCleanup.registerCleanup(EncodingValidator::reinitInstance);
    }
}
开发者ID:mydw,项目名称:mydw,代码行数:7,代码来源:EncodingValidator.cpp


示例12: initializeExceptionMsgLoader

void XMLInitializer::initializeExceptionMsgLoader()
{
    sMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgExceptDomain);
    if (sMsgLoader) {
        msgLoaderCleanup.registerCleanup(XMLException::reinitMsgLoader);
    }
}
开发者ID:ksmyth,项目名称:xerces-c,代码行数:7,代码来源:XMLException.cpp


示例13: initializeRangeTokenMap

void XMLInitializer::initializeRangeTokenMap()
{
    RangeTokenMap::fInstance = new RangeTokenMap(XMLPlatformUtils::fgMemoryManager);
    if (RangeTokenMap::fInstance)
    {
        rangeTokMapInstanceCleanup.registerCleanup(RangeTokenMap::reinitInstance);
        RangeTokenMap::fInstance->buildTokenRanges();
    }
}
开发者ID:brock7,项目名称:TianLong,代码行数:9,代码来源:RangeTokenMap.cpp


示例14:

void
RegularExpression::staticInitialize(MemoryManager*  memoryManager)
{
    fWordRange = TokenFactory::staticGetRange(fgUniIsWord, false);

	if (fWordRange == 0)
		ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Regex_RangeTokenGetError, fgUniIsWord, memoryManager);

    WordRangeCleanup.registerCleanup(localCleanup);
}
开发者ID:ksmyth,项目名称:xerces-c,代码行数:10,代码来源:RegularExpression.cpp


示例15: getDOMImplSrcVector

// -----------------------------------------------------------------------
//  Get the static data
// -----------------------------------------------------------------------
RefVectorOf<DOMImplementationSource>* getDOMImplSrcVector()
{
    // Note: we are not synchronizing on creation since that caller is doing
    //       it (i.e. caller is locking a mutex before calling us)
    if (!gDOMImplSrcVector)
    {
        gDOMImplSrcVector = new RefVectorOf<DOMImplementationSource>(3, false);
        cleanupDOMImplSrcVector.registerCleanup(reinitDOMImplSrcVector);
    }

    return gDOMImplSrcVector;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:15,代码来源:DOMImplementationRegistry.cpp


示例16: lockInit

static XMLMutex& getErrRprtrMutex()
{
    if (!sErrRprtrMutex)
    {
        XMLMutexLock lockInit(XMLPlatformUtils::fgAtomicMutex);

        if (!sErrRprtrMutex)
        {
            sErrRprtrMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
            errRprtrMutexCleanup.registerCleanup(reinitErrRprtrMutex);
        }
    }

    return *sErrRprtrMutex;
}
开发者ID:brock7,项目名称:TianLong,代码行数:15,代码来源:XSDErrorReporter.cpp


示例17: lock

static XMLMutex& getEncValMutex()
{
    if (!sEncValMutex)
    {
        XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);

        // If we got here first, then register it and set the registered flag
        if (!sEncValMutex)
        {
            sEncValMutex = new XMLMutex;
            encValRegistryCleanup.registerCleanup(reinitEncValMutex);
        }
    }
    return *sEncValMutex;
}
开发者ID:,项目名称:,代码行数:15,代码来源:


示例18: instance

// ---------------------------------------------------------------------------
//  RangeTokenMap: Instance methods
// ---------------------------------------------------------------------------
RangeTokenMap* RangeTokenMap::instance()
{
    if (!fInstance)
    {
        XMLMutexLock lock(&getRangeTokMapMutex());

        if (!fInstance)
        {
            fInstance = new RangeTokenMap(XMLPlatformUtils::fgMemoryManager);
            rangeTokMapInstanceCleanup.registerCleanup(RangeTokenMap::reinitInstance);
        }
    }

    return (fInstance);
}
开发者ID:brock7,项目名称:TianLong,代码行数:18,代码来源:RangeTokenMap.cpp


示例19: instance

// ---------------------------------------------------------------------------
//  RangeTokenMap: Instance methods
// ---------------------------------------------------------------------------
RangeTokenMap* RangeTokenMap::instance()
{
    if (!fInstance)
    {
        XMLMutexLock lock(&getRangeTokMapMutex());

        if (!fInstance)
        {
            fInstance = new RangeTokenMap();
            rangeTokMapInstanceCleanup.registerCleanup(RangeTokenMap::reinitInstance);
        }
    }

    return (fInstance);
}
开发者ID:js422,项目名称:PERL,代码行数:18,代码来源:RangeTokenMap.cpp


示例20: instance

// ---------------------------------------------------------------------------
//  EncodingValidator: Instance methods
// ---------------------------------------------------------------------------
EncodingValidator* EncodingValidator::instance()
{
    if (!fInstance)
    {
        XMLMutexLock lock(&getEncValMutex());

        if (!fInstance)
        { 
            fInstance = new EncodingValidator();
            instanceCleanup.registerCleanup(EncodingValidator::reinitInstance);
        }
    }

    return (fInstance);
}
开发者ID:,项目名称:,代码行数:18,代码来源:



注:本文中的XMLRegisterCleanup类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ XMLSerializer类代码示例发布时间:2022-05-31
下一篇:
C++ XMLReader类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap