本文整理汇总了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();
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
}
}
示例7:
void XMLInitializer::initializeMsgLoader4DOM()
{
sMsgLoader4DOM = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLDOMMsgDomain);
if (sMsgLoader4DOM) {
msgLoader4DOMCleanup.registerCleanup(reinitMsgLoader4DOM);
}
}
示例8: initializeEmptyNodeList
void XMLInitializer::initializeEmptyNodeList()
{
gEmptyNodeList = new DOMNodeListImpl(0);
if (gEmptyNodeList) {
emptyNodeListCleanup.registerCleanup(reinitEmptyNodeList);
}
}
示例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;
}
示例10: initializeDOMImplementationImpl
void XMLInitializer::initializeDOMImplementationImpl()
{
gDomimp = new DOMImplementationImpl;
if (gDomimp) {
implementationCleanup.registerCleanup(reinitImplementation);
}
}
示例11: initializeEncodingValidator
void XMLInitializer::initializeEncodingValidator()
{
EncodingValidator::fInstance = new EncodingValidator();
if (EncodingValidator::fInstance) {
instanceCleanup.registerCleanup(EncodingValidator::reinitInstance);
}
}
示例12: initializeExceptionMsgLoader
void XMLInitializer::initializeExceptionMsgLoader()
{
sMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgExceptDomain);
if (sMsgLoader) {
msgLoaderCleanup.registerCleanup(XMLException::reinitMsgLoader);
}
}
示例13: initializeRangeTokenMap
void XMLInitializer::initializeRangeTokenMap()
{
RangeTokenMap::fInstance = new RangeTokenMap(XMLPlatformUtils::fgMemoryManager);
if (RangeTokenMap::fInstance)
{
rangeTokMapInstanceCleanup.registerCleanup(RangeTokenMap::reinitInstance);
RangeTokenMap::fInstance->buildTokenRanges();
}
}
示例14:
void
RegularExpression::staticInitialize(MemoryManager* memoryManager)
{
fWordRange = TokenFactory::staticGetRange(fgUniIsWord, false);
if (fWordRange == 0)
ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Regex_RangeTokenGetError, fgUniIsWord, memoryManager);
WordRangeCleanup.registerCleanup(localCleanup);
}
示例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;
}