亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stringpool.cpp

?? IBM的解析xml的工具Xerces的源代碼
?? CPP
字號:
/* * Copyright 1999-2004 The Apache Software Foundation. *  * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at *  *      http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//* * $Log: StringPool.cpp,v $ * Revision 1.11  2004/09/08 13:56:23  peiyongz * Apache License Version 2.0 * * Revision 1.10  2004/03/02 23:21:37  peiyongz * eliminate leakage * * Revision 1.9  2004/01/29 11:48:46  cargilld * Code cleanup changes to get rid of various compiler diagnostic messages. * * Revision 1.8  2003/12/17 00:18:35  cargilld * Update to memory management so that the static memory manager (one used to call Initialize) is only for static data. * * Revision 1.7  2003/10/29 16:18:41  peiyongz * Implement serialization/deserialization * * Revision 1.6  2003/10/09 13:49:30  neilg * make StringPool functions virtual so that we can implement a synchronized version of StringPool for thread-safe updates. * * Revision 1.5  2003/05/18 14:02:05  knoaman * Memory manager implementation: pass per instance manager. * * Revision 1.4  2003/05/16 06:01:52  knoaman * Partial implementation of the configurable memory manager. * * Revision 1.3  2003/05/15 19:07:45  knoaman * Partial implementation of the configurable memory manager. * * Revision 1.2  2002/11/04 15:22:04  tng * C++ Namespace Support. * * Revision 1.1.1.1  2002/02/01 22:22:12  peiyongz * sane_include * * Revision 1.6  2001/10/22 15:43:35  tng * [Bug 3361] "String pool id was not legal" error in Attributes::getURI(). * * Revision 1.5  2000/07/07 22:16:51  jpolast * remove old put(value) function.  use put(key,value) instead. * * Revision 1.4  2000/05/15 22:31:20  andyh * Replace #include<memory.h> with <string.h> everywhere. * * Revision 1.3  2000/03/02 19:54:46  roddey * This checkin includes many changes done while waiting for the * 1.1.0 code to be finished. I can't list them all here, but a list is * available elsewhere. * * Revision 1.2  2000/02/06 07:48:04  rahulj * Year 2K copyright swat. * * Revision 1.1.1.1  1999/11/09 01:05:10  twl * Initial checkin * * Revision 1.2  1999/11/08 20:45:14  rahul * Swat for adding in Product name and CVS comment log variable. * */// ---------------------------------------------------------------------------//  Includes// ---------------------------------------------------------------------------#include <xercesc/util/StringPool.hpp>#include <assert.h>XERCES_CPP_NAMESPACE_BEGIN// ---------------------------------------------------------------------------//  StringPool::PoolElem: Constructors and Destructor// ---------------------------------------------------------------------------XMLStringPool::PoolElem::PoolElem( const   XMLCh* const string                                 , const unsigned int id                                 , MemoryManager* const manager) :    fId(id)    , fString(0)    , fMemoryManager(manager){    fString = XMLString::replicate(string, fMemoryManager);}XMLStringPool::PoolElem::~PoolElem(){    fMemoryManager->deallocate(fString); //delete [] fString;}// ---------------------------------------------------------------------------//  StringPool::PoolElem: Public methods// ---------------------------------------------------------------------------voidXMLStringPool::PoolElem::reset(const XMLCh* const string, const unsigned int id){    fId = id;    fMemoryManager->deallocate(fString);//delete [] fString;    fString = XMLString::replicate(string, fMemoryManager);}// ---------------------------------------------------------------------------//  XMLStringPool: Constructors and Destructor// ---------------------------------------------------------------------------XMLStringPool::XMLStringPool(const  unsigned int  modulus,                             MemoryManager* const manager) :    fMemoryManager(manager)    , fIdMap(0)    , fHashTable(0)    , fMapCapacity(64)    , fCurId(1){    // Create the hash table, passing it the modulus    fHashTable = new (fMemoryManager) RefHashTableOf<PoolElem>(modulus, fMemoryManager);    // Do an initial allocation of the id map and zero it all out    fIdMap = (PoolElem**) fMemoryManager->allocate    (        fMapCapacity * sizeof(PoolElem*)    ); //new PoolElem*[fMapCapacity];    memset(fIdMap, 0, sizeof(PoolElem*) * fMapCapacity);}XMLStringPool::~XMLStringPool(){    delete fHashTable;    fMemoryManager->deallocate(fIdMap); //delete [] fIdMap;}// ---------------------------------------------------------------------------//  XMLStringPool: Pool management methods// ---------------------------------------------------------------------------unsigned int XMLStringPool::addOrFind(const XMLCh* const newString){    PoolElem* elemToFind = fHashTable->get(newString);    if (elemToFind)        return elemToFind->fId;    return addNewEntry(newString);}bool XMLStringPool::exists(const XMLCh* const newString) const{    return fHashTable->containsKey(newString);}bool XMLStringPool::exists(const unsigned int id) const{    if (!id || (id >= fCurId))        return false;    return true;}void XMLStringPool::flushAll(){    fCurId = 1;    fHashTable->removeAll();}unsigned int XMLStringPool::getId(const XMLCh* const toFind) const{    PoolElem* elemToFind = fHashTable->get(toFind);    if (elemToFind)        return elemToFind->fId;    // Not found, so return zero, which is never a legal id    return 0;}const XMLCh* XMLStringPool::getValueForId(const unsigned int id) const{    if (!id || (id >= fCurId))        ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::StrPool_IllegalId, fMemoryManager);    // Just index the id map and return that element's string    return fIdMap[id]->fString;}unsigned int XMLStringPool::getStringCount() const{    return fCurId-1;}// ---------------------------------------------------------------------------//  XMLStringPool: Private helper methods// ---------------------------------------------------------------------------unsigned int XMLStringPool::addNewEntry(const XMLCh* const newString){    // See if we need to expand the id map    if (fCurId == fMapCapacity)    {        // Calculate the new capacity, create a temp new map, and zero it        const unsigned int newCap = (unsigned int)(fMapCapacity * 1.5);        PoolElem** newMap = (PoolElem**) fMemoryManager->allocate        (            newCap * sizeof(PoolElem*)        ); //new PoolElem*[newCap];        memset(newMap, 0, sizeof(PoolElem*) * newCap);        //        //  Copy over the old elements from the old map. They are just pointers        //  so we can do it all at once.        //        memcpy(newMap, fIdMap, sizeof(PoolElem*) * fMapCapacity);        // Clean up the old map and store the new info        fMemoryManager->deallocate(fIdMap); //delete [] fIdMap;        fIdMap = newMap;        fMapCapacity = newCap;    }    //    //  Ok, now create a new element and add it to the hash table. Then store    //  this new element in the id map at the current id index, then bump the    //  id index.    //    PoolElem* newElem = new (fMemoryManager) PoolElem(newString, fCurId, fMemoryManager);    fHashTable->put((void*)(newElem->getKey()), newElem);    fIdMap[fCurId] = newElem;    // Bump the current id and return the id of the new elem we just added    fCurId++;    return newElem->fId;}/*** * Support for Serialization/De-serialization ***/IMPL_XSERIALIZABLE_TOCREATE(XMLStringPool)void XMLStringPool::serialize(XSerializeEngine& serEng){    /***     * Since we are pretty sure that fIdMap and fHashTable is      * not shared by any other object, therefore there is no owned/referenced     * issue. Thus we can serialize the raw data only, rather than serializing      * both fIdMap and fHashTable.     *     * And we can rebuild the fIdMap and fHashTable out of the raw data during     * deserialization.     *    ***/    if (serEng.isStoring())    {        serEng<<fCurId;        for (unsigned int index = 1; index < fCurId; index++)        {            const XMLCh* stringData = getValueForId(index);            serEng.writeString(stringData);        }    }    else    {        unsigned int mapSize;        serEng>>mapSize;        assert(1 == fCurId);  //make sure empty        for (unsigned int index = 1; index < mapSize; index++)        {            XMLCh* stringData;            serEng.readString(stringData);            addNewEntry(stringData);            //we got to deallocate this string             //since stringpool will duplicate this string in the PoolElem and own that copy            fMemoryManager->deallocate(stringData);        }    }}XMLStringPool::XMLStringPool(MemoryManager* const manager) :    fMemoryManager(manager)    , fIdMap(0)    , fHashTable(0)    , fMapCapacity(64)    , fCurId(1){    // Create the hash table, passing it the modulus    fHashTable = new (fMemoryManager) RefHashTableOf<PoolElem>(109, fMemoryManager);    // Do an initial allocation of the id map and zero it all out    fIdMap = (PoolElem**) fMemoryManager->allocate    (        fMapCapacity * sizeof(PoolElem*)    ); //new PoolElem*[fMapCapacity];    memset(fIdMap, 0, sizeof(PoolElem*) * fMapCapacity);}XERCES_CPP_NAMESPACE_END

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩成人综合天天影院| 亚洲另类春色校园小说| 中文字幕在线播放不卡一区| 亚洲福利视频一区| 成人免费视频网站在线观看| 精品少妇一区二区三区日产乱码| 亚洲黄色小视频| 国产69精品久久777的优势| 欧美大片一区二区| 丝袜a∨在线一区二区三区不卡| av亚洲精华国产精华精| 日韩一级免费观看| 丝袜诱惑亚洲看片| 一本大道久久a久久综合婷婷| 久久久www成人免费无遮挡大片| 午夜欧美电影在线观看| 在线中文字幕一区二区| 欧美韩日一区二区三区四区| 狠狠色综合色综合网络| 欧美优质美女网站| 亚洲六月丁香色婷婷综合久久 | 天堂午夜影视日韩欧美一区二区| 国产a视频精品免费观看| 日韩精品一区二区三区老鸭窝| 亚洲国产精品视频| 91成人免费网站| 亚洲精选在线视频| 91亚洲精品乱码久久久久久蜜桃| 中日韩av电影| 国产成a人亚洲| 国产精品久久久久一区二区三区 | 亚洲三级电影网站| 99久久er热在这里只有精品66| 日本一区二区三区dvd视频在线| 国产精品一区专区| 2023国产精华国产精品| 国产一区在线看| 久久香蕉国产线看观看99| 国产真实乱偷精品视频免| 精品国产网站在线观看| 国产一区二区三区视频在线播放| 久久先锋影音av鲁色资源网| 国内精品嫩模私拍在线| 国产亚洲成av人在线观看导航| 国产一区二区在线看| 国产清纯白嫩初高生在线观看91 | 在线播放/欧美激情| 免费观看在线色综合| 日韩一级黄色大片| 免费在线观看不卡| 国产性做久久久久久| 成人av免费在线| 亚洲精品成人在线| 在线综合亚洲欧美在线视频| 麻豆精品视频在线| 久久九九久久九九| 91行情网站电视在线观看高清版| 午夜精品久久久久久久久| 精品国产伦一区二区三区观看方式| 激情综合网av| 久久久久久久久久久久电影| 91碰在线视频| 日韩成人伦理电影在线观看| 26uuu成人网一区二区三区| 处破女av一区二区| 亚洲最大色网站| 欧美tickling网站挠脚心| 成人国产视频在线观看| 日韩电影在线一区二区| 中文字幕免费不卡| 91精品一区二区三区在线观看| 国产不卡高清在线观看视频| 亚洲综合一区二区三区| 精品久久久久久久久久久久包黑料 | 午夜精品福利一区二区蜜股av | 日韩一区二区在线播放| 成人小视频在线| 日韩二区三区四区| 亚洲视频中文字幕| 久久天天做天天爱综合色| 在线观看日韩国产| 国产成人午夜精品影院观看视频 | 99精品一区二区| 麻豆91在线播放| 亚洲色大成网站www久久九九| 欧美一级久久久| 欧美色图激情小说| av在线不卡免费看| 国产成a人亚洲精| 美女www一区二区| 首页国产丝袜综合| 一区二区三区电影在线播| 国产亚洲成aⅴ人片在线观看 | 国产精品污www在线观看| 欧美日韩国产首页| 91亚洲国产成人精品一区二区三| 久久成人久久爱| 偷偷要91色婷婷| 亚洲福利视频一区二区| 亚洲三级在线免费观看| 亚洲国产精品av| 国产人成亚洲第一网站在线播放| 精品久久久久久久久久久院品网| 91精品国产综合久久国产大片| 欧美性感一类影片在线播放| 94-欧美-setu| 91丨国产丨九色丨pron| www.性欧美| 91网上在线视频| 色综合一区二区| 色综合久久天天| 97超碰欧美中文字幕| 99免费精品在线观看| 成人av在线资源网| 91免费视频网| 成人黄色小视频| 成人一区二区在线观看| 成人爽a毛片一区二区免费| 波多野结衣中文字幕一区 | 国产精品不卡在线| 综合亚洲深深色噜噜狠狠网站| 国产精品视频麻豆| 中文字幕一区在线观看视频| 亚洲免费看黄网站| 亚洲综合999| 日本在线不卡视频一二三区| 蜜臀av一级做a爰片久久| 久88久久88久久久| 国产一区二区精品久久| 成人综合激情网| 91在线国产观看| 在线播放视频一区| 精品国产免费人成电影在线观看四季 | 日韩一区二区麻豆国产| 欧美变态口味重另类| 国产亚洲一二三区| 亚洲色图一区二区三区| 日韩在线观看一区二区| 国产伦精品一区二区三区视频青涩 | 欧美精品vⅰdeose4hd| 91精品国产欧美一区二区18| 久久久激情视频| 一区二区三区四区不卡在线| 午夜成人免费视频| 国产福利电影一区二区三区| 91原创在线视频| 日韩欧美中文一区二区| 国产三级一区二区| 亚洲最快最全在线视频| 久久99国产精品久久99| 99久久婷婷国产综合精品电影 | 日日摸夜夜添夜夜添国产精品 | 亚洲欧美偷拍三级| 麻豆精品视频在线观看| 91亚洲男人天堂| 精品国产一区二区在线观看| 亚洲视频 欧洲视频| 日本美女一区二区三区视频| 成人免费看的视频| 欧美顶级少妇做爰| 国产精品伦一区| 麻豆91精品视频| 色婷婷精品久久二区二区蜜臂av| 日韩欧美一级在线播放| 亚洲精品免费一二三区| 精品无人区卡一卡二卡三乱码免费卡| 成人看片黄a免费看在线| 91精品在线观看入口| 亚洲视频一二三| 国产麻豆精品95视频| 91精品国产黑色紧身裤美女| 亚洲欧洲国产日韩| 国产老肥熟一区二区三区| 欧美日韩和欧美的一区二区| 中文字幕亚洲区| 国产精品1区2区3区在线观看| 欧美探花视频资源| 中文字幕亚洲一区二区av在线| 国产九色精品成人porny| 51久久夜色精品国产麻豆| 亚洲一区二区精品久久av| 成人黄页毛片网站| 国产欧美日韩三级| 精品一区二区三区影院在线午夜 | 欧美日韩国产免费一区二区| 1024成人网色www| 国产91在线|亚洲| 国产三级三级三级精品8ⅰ区| 美美哒免费高清在线观看视频一区二区| 欧美色视频一区| 亚洲黄色小说网站| 色婷婷av一区二区三区大白胸 | 欧美中文字幕一二三区视频| 国产精品国产三级国产aⅴ中文| 国产风韵犹存在线视精品| 欧美精品一区二区精品网| 激情欧美一区二区三区在线观看| 69堂亚洲精品首页| 午夜视频在线观看一区二区| 在线亚洲精品福利网址导航|