XMLElementDecl* SchemaGrammar::putElemDecl (const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const prefixName , const XMLCh* const , unsigned int scope , const bool notDeclared) { SchemaElementDecl* retVal = new (fMemoryManager) SchemaElementDecl ( prefixName , baseName , uriId , SchemaElementDecl::Any , Grammar::TOP_LEVEL_SCOPE , fMemoryManager ); if(notDeclared) { if(!fElemNonDeclPool) fElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool<SchemaElementDecl>(29, true, 128, fMemoryManager); retVal->setId(fElemNonDeclPool->put((void*)retVal->getBaseName(), uriId, scope, retVal)); } else { retVal->setId(fElemDeclPool->put((void*)retVal->getBaseName(), uriId, scope, retVal)); } return retVal; }
// ----------------------------------------------------------------------- // Virtual methods // ----------------------------------------------------------------------- XMLElementDecl* SchemaGrammar::findOrAddElemDecl (const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const prefixName , const XMLCh* const qName , unsigned int scope , bool& wasAdded ) { // See it it exists SchemaElementDecl* retVal = (SchemaElementDecl*) getElemDecl(uriId, baseName, qName, scope); // if not, then add this in if (!retVal) { retVal = new (fMemoryManager) SchemaElementDecl ( prefixName , baseName , uriId , SchemaElementDecl::Any , Grammar::TOP_LEVEL_SCOPE , fMemoryManager ); if(!fElemNonDeclPool) fElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool<SchemaElementDecl>(29, true, 128, fMemoryManager); const unsigned int elemId = fElemNonDeclPool->put((void*)retVal->getBaseName(), uriId, scope, retVal); retVal->setId(elemId); wasAdded = true; } else { wasAdded = false; } return retVal; }