本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: instance
// ---------------------------------------------------------------------------
// RangeTokenMap: Instance methods
// ---------------------------------------------------------------------------
RangeTokenMap* RangeTokenMap::instance()
{
if (!fInstance)
{
XMLMutexLock lock(&getRangeTokMapMutex());
if (!fInstance)
{
fInstance = new RangeTokenMap();
rangeTokMapInstanceCleanup.registerCleanup(RangeTokenMap::reinitInstance);
}
}
return (fInstance);
}
示例6: instance
// ---------------------------------------------------------------------------
// EncodingValidator: Instance methods
// ---------------------------------------------------------------------------
EncodingValidator* EncodingValidator::instance()
{
if (!fInstance)
{
XMLMutexLock lock(&getEncValMutex());
if (!fInstance)
{
fInstance = new EncodingValidator();
instanceCleanup.registerCleanup(EncodingValidator::reinitInstance);
}
}
return (fInstance);
}
示例7: lock
XMLMutex& getDOMImplSrcVectorMutex()
{
if (!gDOMImplSrcVectorMutex)
{
XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);
if (!gDOMImplSrcVectorMutex)
{
gDOMImplSrcVectorMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
cleanupDOMImplSrcVectorMutex.registerCleanup(reinitDOMImplSrcVectorMutex);
}
}
return *gDOMImplSrcVectorMutex;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
}
}
示例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;
}