当前位置: 首页>>代码示例>>C++>>正文


C++ XMLRegisterCleanup类代码示例

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


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


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