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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bitset.cpp

?? IBM的解析xml的工具Xerces的源代碼
?? CPP
字號(hào):
/* * Copyright 1999-2000,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: BitSet.cpp,v $ * Revision 1.4  2004/09/08 13:56:21  peiyongz * Apache License Version 2.0 * * Revision 1.3  2003/05/15 19:04:35  knoaman * Partial implementation of the configurable memory manager. * * Revision 1.2  2002/11/04 15:22:03  tng * C++ Namespace Support. * * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz * sane_include * * Revision 1.4  2000/03/02 19:54:38  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.3  2000/02/06 07:48:01  rahulj * Year 2K copyright swat. * * Revision 1.2  1999/12/15 19:38:22  roddey * Simple fix to bit ops comments * * Revision 1.1.1.1  1999/11/09 01:04:09  twl * Initial checkin * * Revision 1.2  1999/11/08 20:45:05  rahul * Swat for adding in Product name and CVS comment log variable. * */// ---------------------------------------------------------------------------//  Includes// ---------------------------------------------------------------------------#include <xercesc/util/BitSet.hpp>#include <xercesc/framework/MemoryManager.hpp>XERCES_CPP_NAMESPACE_BEGIN// ---------------------------------------------------------------------------//  Local const data////  kBitsPerUnit//      The number of bits in each of our allocation units, which is a 32//      bit value in this case.////  kGrowBy//      The minimum allocation units to grow the buffer by.// ---------------------------------------------------------------------------const unsigned int  kBitsPerUnit    = 32;const unsigned int  kGrowBy         = 1;// ---------------------------------------------------------------------------//  BitSet: Constructors and Destructor// ---------------------------------------------------------------------------BitSet::BitSet( const unsigned int size              , MemoryManager* const manager) :    fMemoryManager(manager)    , fBits(0)    , fUnitLen(0){    ensureCapacity(size);}BitSet::BitSet(const BitSet& toCopy) :    fMemoryManager(toCopy.fMemoryManager)    , fBits(0)    , fUnitLen(toCopy.fUnitLen){    fBits = (unsigned long*) fMemoryManager->allocate    (        fUnitLen * sizeof(unsigned long)    ); //new unsigned long[fUnitLen];    for (unsigned int i = 0; i < fUnitLen; i++)        fBits[i] = toCopy.fBits[i];}BitSet::~BitSet(){    fMemoryManager->deallocate(fBits); //delete [] fBits;}// ---------------------------------------------------------------------------//  BitSet: Equality methods// ---------------------------------------------------------------------------bool BitSet::equals(const BitSet& other) const{    if (this == &other)        return true;    if (fUnitLen != other.fUnitLen)        return false;    for (unsigned int i = 0; i < fUnitLen; i++)    {        if (fBits[i] != other.fBits[i])            return false;    }    return true;}// ---------------------------------------------------------------------------//  BitSet: Getter methods// ---------------------------------------------------------------------------bool BitSet::get(const unsigned int index) const{    const unsigned int unitOfBit = (index / kBitsPerUnit);    const unsigned int bitWithinUnit = index % kBitsPerUnit;    //    //  If the index is beyond our size, don't actually expand. Just return    //  false, which is what the state would be if we did expand it.    //    bool retVal = false;    if (unitOfBit <= fUnitLen)    {        if (fBits[unitOfBit] & (1 << bitWithinUnit))            retVal = true;    }    return retVal;}unsigned int BitSet::size() const{    return fUnitLen * kBitsPerUnit;}// ---------------------------------------------------------------------------//  BitSet: Setter methods// ---------------------------------------------------------------------------bool BitSet::allAreCleared() const{    for (unsigned int index = 0; index < fUnitLen; index++)    {        if (fBits[index])            return false;    }    return true;}bool BitSet::allAreSet() const{    for (unsigned int index = 0; index < fUnitLen; index++)    {        if (fBits[index] != 0xFFFFFFFF)            return false;    }    return true;}void BitSet::clearAll(){    // Just zero out all the units    for (unsigned int index = 0; index < fUnitLen; index++)        fBits[index] = 0;}void BitSet::clear(const unsigned int index){    ensureCapacity(index+1);    const int unitOfBit = (index / kBitsPerUnit);    const int bitWithinUnit = index % kBitsPerUnit;    fBits[unitOfBit] &= ~(1UL << bitWithinUnit);}void BitSet::set(const unsigned int index){    ensureCapacity(index+1);    const int unitOfBit = (index / kBitsPerUnit);    const int bitWithinUnit = index % kBitsPerUnit;    fBits[unitOfBit] |= (1UL << bitWithinUnit);}// ---------------------------------------------------------------------------//  BitSet: Bitwise logical methods// ---------------------------------------------------------------------------void BitSet::andWith(const BitSet& other){    if (fUnitLen < other.fUnitLen)        ensureCapacity(other.fUnitLen * kBitsPerUnit);    for (unsigned int index = 0; index < other.fUnitLen; index++)        fBits[index] &= other.fBits[index];}void BitSet::orWith(const BitSet& other){    if (fUnitLen < other.fUnitLen)        ensureCapacity(other.fUnitLen * kBitsPerUnit);    for (unsigned int index = 0; index < other.fUnitLen; index++)        fBits[index] |= other.fBits[index];}void BitSet::xorWith(const BitSet& other){    if (fUnitLen < other.fUnitLen)        ensureCapacity(other.fUnitLen * kBitsPerUnit);    for (unsigned int index = 0; index < other.fUnitLen; index++)        fBits[index] ^= other.fBits[index];}// ---------------------------------------------------------------------------//  BitSet: Miscellaneous methods// ---------------------------------------------------------------------------unsigned int BitSet::hash(const unsigned int hashModulus) const{    const unsigned char* pBytes = (const unsigned char*)fBits;    const int unsigned len = fUnitLen * sizeof(unsigned long);    unsigned int  hashVal = 0;    for (unsigned int index = 0; index < len; index++)    {        hashVal <<= 1;        hashVal ^= *pBytes;    }    return hashVal % hashModulus;}// ---------------------------------------------------------------------------//  BitSet: Private methods// ---------------------------------------------------------------------------void BitSet::ensureCapacity(const unsigned int size){    // Calculate the units required to hold the passed bit count.    unsigned int unitsNeeded = size / kBitsPerUnit;    if (size % kBitsPerUnit)        unitsNeeded++;    // If its more than we have, then reallocate    if (unitsNeeded > fUnitLen)    {        // Regrow the unit length by at least the expansion unit        if (unitsNeeded < (fUnitLen + kGrowBy))            unitsNeeded = fUnitLen + kGrowBy;        // Allocate the array, copy the old stuff, and zero the new stuff        unsigned long* newBits = (unsigned long*) fMemoryManager->allocate        (            unitsNeeded * sizeof(unsigned long)        ); //new unsigned long[unitsNeeded];        unsigned int index;        for (index = 0; index < fUnitLen; index++)            newBits[index] = fBits[index];        for (; index < unitsNeeded; index++)            newBits[index] = 0;        fMemoryManager->deallocate(fBits); //delete [] fBits;        fBits = newBits;        fUnitLen = unitsNeeded;    }}XERCES_CPP_NAMESPACE_END

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲高清视频在线| 激情成人午夜视频| 亚洲欧美综合在线精品| 欧美大片在线观看一区二区| 在线观看欧美日本| 91蝌蚪porny成人天涯| 国产成人啪免费观看软件| 丝袜国产日韩另类美女| 亚洲精品成人a在线观看| 国产精品乱人伦| 欧美一级在线免费| 欧美另类变人与禽xxxxx| 91黄色免费网站| 99视频精品在线| 成人短视频下载| 国产九九视频一区二区三区| 久草这里只有精品视频| 蜜桃av一区二区在线观看 | 亚洲品质自拍视频| 国产精品蜜臀av| 国产欧美一区二区在线| 国产清纯白嫩初高生在线观看91| 久久综合久久综合久久| 精品999久久久| 久久精品一二三| 国产欧美日韩在线视频| 国产色婷婷亚洲99精品小说| 国产日韩欧美精品在线| 亚洲国产精品ⅴa在线观看| 国产午夜精品福利| 国产精品天干天干在观线| 中文幕一区二区三区久久蜜桃| 91麻豆精品国产自产在线 | 色婷婷精品大在线视频| 91麻豆精品在线观看| 一本大道av伊人久久综合| 99视频国产精品| 欧美在线你懂得| 91麻豆精品国产91久久久使用方法 | 日韩午夜精品电影| 精品久久久久久久久久久久包黑料| 日韩一区二区影院| 久久久午夜精品理论片中文字幕| 久久久午夜精品| 亚洲天堂成人网| 亚洲午夜激情网站| 久久精品久久99精品久久| 国产在线精品免费av| 国产99精品国产| 91视频一区二区三区| 91精品福利视频| 欧美一区二区三区免费| 久久综合丝袜日本网| 中文字幕一区二| 亚洲国产精品人人做人人爽| 久久激情五月激情| 粉嫩一区二区三区在线看| 在线精品视频小说1| 日韩一区二区免费在线观看| 久久久久久夜精品精品免费| 中文字幕av不卡| 亚洲国产精品久久人人爱| 美国av一区二区| 成人白浆超碰人人人人| 欧美视频一区在线观看| 精品国产伦一区二区三区观看方式 | 欧美一区二区三区白人| 国产欧美日韩一区二区三区在线观看 | 亚洲欧洲日产国码二区| 亚洲欧美激情一区二区| 秋霞影院一区二区| 成人精品在线视频观看| 777久久久精品| 国产精品久久久久久妇女6080| 亚洲第一福利一区| 成人教育av在线| 欧美精品第一页| 国产精品久久久久影院亚瑟 | 国产一区欧美二区| 色哟哟国产精品免费观看| 精品99一区二区| 亚洲国产成人高清精品| 国产91精品在线观看| 日韩一级片在线播放| 一区二区三区四区在线播放 | 亚洲综合小说图片| 国产高清在线精品| 欧美精品日韩精品| 中文字幕一区av| 国产制服丝袜一区| 欧美在线一二三四区| 中文字幕欧美激情| 精品制服美女久久| 欧美日韩国产不卡| 最新国产精品久久精品| 国产在线精品视频| 欧美在线观看视频一区二区三区| 久久婷婷成人综合色| 日韩av高清在线观看| 一本一道久久a久久精品综合蜜臀| 久久综合九色综合久久久精品综合| 亚洲第一成人在线| 一本一本久久a久久精品综合麻豆| 久久久不卡网国产精品一区| 亚洲激情图片一区| 99免费精品在线观看| 欧美韩国日本综合| 国产精品99久久久| www激情久久| 美女视频一区在线观看| 91麻豆精品国产自产在线观看一区| 亚洲色图一区二区三区| av电影在线不卡| 久久精品水蜜桃av综合天堂| 玖玖九九国产精品| 欧美va亚洲va香蕉在线| 日韩av午夜在线观看| 在线不卡中文字幕| 亚洲女与黑人做爰| 不卡大黄网站免费看| 欧美国产一区二区| 粉嫩av一区二区三区粉嫩| 国产亚洲成av人在线观看导航| 国产最新精品免费| 久久久久免费观看| 久久99国产精品久久99果冻传媒| 欧美日韩一区成人| 肉肉av福利一精品导航| 日韩一区二区三区四区五区六区| 日韩主播视频在线| 欧美www视频| 国产黄色精品视频| 国产精品久久久久久久第一福利| 国产精品综合二区| 亚洲国产精品成人综合| 不卡一区中文字幕| 亚洲免费av高清| 欧美日本国产视频| 欧美第一区第二区| 国内精品国产三级国产a久久| 国产精品日韩精品欧美在线| 欧美视频在线一区| 国产成人免费在线观看不卡| 亚洲免费视频成人| 精品美女一区二区| 91在线国产观看| 麻豆极品一区二区三区| 亚洲视频电影在线| 欧美mv日韩mv国产| 色噜噜狠狠色综合欧洲selulu | 欧美人xxxx| 国产传媒日韩欧美成人| 一区二区高清视频在线观看| 欧美电影免费观看高清完整版在线| 高清av一区二区| 日韩vs国产vs欧美| 亚洲品质自拍视频| 久久嫩草精品久久久精品| 欧美午夜理伦三级在线观看| 国产69精品久久99不卡| 日韩电影在线免费观看| 亚洲欧美偷拍另类a∨色屁股| 精品国产乱码久久久久久影片| 欧美探花视频资源| 成人午夜精品一区二区三区| 麻豆专区一区二区三区四区五区| 亚洲私人黄色宅男| 国产亚洲精品精华液| 欧美日韩精品一区二区在线播放| 不卡一二三区首页| 乱中年女人伦av一区二区| 一区二区激情小说| ...av二区三区久久精品| 久久午夜国产精品| 日韩一卡二卡三卡四卡| 欧美三级视频在线| 91亚洲精品久久久蜜桃| 国产99久久久精品| 激情综合亚洲精品| 日韩极品在线观看| 午夜视频在线观看一区| 亚洲欧美另类小说视频| 国产精品人妖ts系列视频| 欧美电视剧免费全集观看| 555www色欧美视频| 欧美日韩精品一区二区三区蜜桃| 一本久道中文字幕精品亚洲嫩| 大胆亚洲人体视频| 福利视频网站一区二区三区| 精品亚洲成av人在线观看| 蜜臀99久久精品久久久久久软件| 亚洲成人激情综合网| 一区二区三区在线免费观看| 综合网在线视频| 亚洲欧美日韩国产中文在线| 国产精品久久久久久亚洲毛片| 国产精品水嫩水嫩| 中文字幕五月欧美| 中文字幕欧美国产| 国产精品久久久久久久久久久免费看|