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


C++ XMLRegisterCleanup::registerCleanup方法代码示例

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


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

示例1: lockInit

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

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

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

示例2: lock

//  We need to fault in this mutex. But, since its used for synchronization
//  itself, we have to do this the low level way using a compare and swap.
static XMLMutex& gTokenFactoryMutex()
{
    if (!sTokFactoryMutexRegistered)
    {
        XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);

        if (!sTokFactoryMutexRegistered)
        {
            sTokFactoryMutex = new XMLMutex;
            tokenFactoryMutexCleanup.registerCleanup(TokenFactory::reinitTokenFactoryMutex);
            sTokFactoryMutexRegistered = true;
        }
    }
    return *sTokFactoryMutex;
}
开发者ID:js422,项目名称:PERL,代码行数:17,代码来源:TokenFactory.cpp

示例3: lock

//  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.
//
DOMImplementationImpl *DOMImplementationImpl::getDOMImplementationImpl()
{
    if (!gDomimp)
    {
        XMLMutexLock lock(&getMutex4DOM());

        if (!gDomimp)
        {
            gDomimp = new DOMImplementationImpl;
            implementationCleanup.registerCleanup(reinitImplementation);
        }
    }

    return gDomimp;
}
开发者ID:,项目名称:,代码行数:23,代码来源:

示例4: lock

static XMLMutex& getRangeTokMapMutex()
{
    if (!sRangeTokMapMutex)
    {
        XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);

        // If we got here first, then register it and set the registered flag
        if (!sRangeTokMapMutex)
        {
            sRangeTokMapMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
            rangeTokMapRegistryCleanup.registerCleanup(reinitRangeTokMapMutex);
        }
    }
    return *sRangeTokMapMutex;
}
开发者ID:brock7,项目名称:TianLong,代码行数:15,代码来源:RangeTokenMap.cpp

示例5: 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

示例6: instance

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

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

    return (fInstance);
}
开发者ID:ksmyth,项目名称:xerces-c,代码行数:18,代码来源:EncodingValidator.cpp

示例7: lock

XMLMutex& getDOMImplSrcVectorMutex()
{
    if (!gDOMImplSrcVectorMutex)
    {
        XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);

        if (!gDOMImplSrcVectorMutex)
        {
            gDOMImplSrcVectorMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
            cleanupDOMImplSrcVectorMutex.registerCleanup(reinitDOMImplSrcVectorMutex);
        }
    }

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

示例8: 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

示例9: getDomConverter

XMLLCPTranscoder*  getDomConverter()
{
    if (!gDomConverter)
    {
        XMLLCPTranscoder* transcoder = XMLPlatformUtils::fgTransService->makeNewLCPTranscoder();
        if (!transcoder)
            XMLPlatformUtils::panic(PanicHandler::Panic_NoDefTranscoder
                                   );

        if (XMLPlatformUtils::compareAndSwap((void **)&gDomConverter, transcoder, 0) != 0)
            delete transcoder;
        else
            cleanupDomConverter.registerCleanup(reinitDomConverter);
    }
    return gDomConverter;
}
开发者ID:mydw,项目名称:mydw,代码行数:16,代码来源:DOMString.cpp

示例10: lockInit

//
//  We need to fault in this mutex. But, since its used for synchronization
//  itself, we have to do this the low level way using a compare and swap.
//
static XMLMutex& gMsgMutex()
{
    if (!sScannerMutexRegistered)
    {
        XMLMutexLock lockInit(XMLPlatformUtils::fgAtomicMutex);

        if (!sScannerMutexRegistered)
        {
            sMsgMutex = new XMLMutex;
            msgMutexCleanup.registerCleanup(XMLException::reinitMsgMutex);
            sScannerMutexRegistered = true;
        }
    }

    return *sMsgMutex;
}
开发者ID:js422,项目名称:PERL,代码行数:20,代码来源:XMLException.cpp

示例11: XMLMutex

XMLMutex& DOMStringHandle::getMutex()
{
    if (!DOMStringHandleMutex)
    {
        XMLMutex* tmpMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
        if (XMLPlatformUtils::compareAndSwap((void**)&DOMStringHandleMutex, tmpMutex, 0))
        {
            // Someone beat us to it, so let's clean up ours
            delete tmpMutex;
        }
        else
            cleanupDomMutex.registerCleanup(reinitDomMutex);

    }

    return *DOMStringHandleMutex;
}
开发者ID:mydw,项目名称:mydw,代码行数:17,代码来源:DOMString.cpp

示例12:

//  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

示例13: getValidMsgLoader

static XMLMsgLoader* getValidMsgLoader()
{
    if (!gValidMsgLoader)
    {
        XMLMutexLock lock(&getErrRprtrMutex());

        if (!gValidMsgLoader)
        {
            gValidMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgValidityDomain);

            if (!gValidMsgLoader)
                XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain);
            else
                cleanupValidMsgLoader.registerCleanup(reinitValidMsgLoader);
        }
    }
    return gValidMsgLoader;
}
开发者ID:brock7,项目名称:TianLong,代码行数:18,代码来源:XSDErrorReporter.cpp

示例14: resetEntityDeclPool

void DTDGrammar::resetEntityDeclPool() {

    // Initialize default entities if not initialized
    if (!sEntityPoolMutexRegistered)
    {
        if (!sEntityPoolMutex)
        {
            XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);
            if (!sEntityPoolMutex)
                sEntityPoolMutex = new XMLMutex;
        }

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

            // If we got here first, then register it and set the registered flag
            if (!sEntityPoolMutexRegistered)
            {
                fDefaultEntities = new NameIdPool<DTDEntityDecl>(11, 12);

                //
                // Add the default entity entries for the character refs that must
                // always be present. We indicate that they are from the internal
                // subset. They aren't really, but they have to look that way so
                // that they are still valid for use within a standalone document.
                //
                // We also mark them as special char entities, which allows them
                // to be used in places whether other non-numeric general entities
                // cannot.
                //
                fDefaultEntities->put(new DTDEntityDecl(XMLUni::fgAmp, chAmpersand, true, true));
                fDefaultEntities->put(new DTDEntityDecl(XMLUni::fgLT, chOpenAngle, true, true));
                fDefaultEntities->put(new DTDEntityDecl(XMLUni::fgGT, chCloseAngle, true, true));
                fDefaultEntities->put(new DTDEntityDecl(XMLUni::fgQuot, chDoubleQuote, true, true));
                fDefaultEntities->put(new DTDEntityDecl(XMLUni::fgApos, chSingleQuote, true, true));

                // register cleanup method
                entityPoolRegistryCleanup.registerCleanup(DTDGrammar::reinitDfltEntities);
                sEntityPoolMutexRegistered = true;
            }
        }
    }
}
开发者ID:js422,项目名称:PERL,代码行数:44,代码来源:DTDGrammar.cpp

示例15: gDocTypeDocument

static DOMDocument& gDocTypeDocument()
{
    if (!sDocument)
    {
        static const XMLCh gCoreStr[] = { chLatin_C, chLatin_o, chLatin_r, chLatin_e, chNull };
        DOMImplementation* impl =  DOMImplementationRegistry::getDOMImplementation(gCoreStr);
        DOMDocument* tmpDoc = impl->createDocument();                   // document type object (DTD).

        if (XMLPlatformUtils::compareAndSwap((void**)&sDocument, tmpDoc, 0))
        {
            // Someone beat us to it, so let's clean up ours
            delete tmpDoc;
        }
        else
        {
            documentCleanup.registerCleanup(reinitDocument);
        }
    }

    return *sDocument;
}
开发者ID:xin3liang,项目名称:platform_external_xerces-cpp,代码行数:21,代码来源:DOMDocumentTypeImpl.cpp


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