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

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

?? cs_hash_table.h

?? c-smile 一個語法類似與JS 又有點像C++的 編譯器
?? H
字號:
/*
*
* cs_hash_table.h
*
* Copyright (c) 2001, 2002
* Andrew Fedoniouk - andrew@terra-informatica.org
* Portions: Serge Kuznetsov -  kuznetsov@deeptown.org
*
* See the file "COPYING" for information on usage 
* and redistribution of this file
*
*/
#ifndef __cs_HASH_TABLE_H
#define __cs_HASH_TABLE_H

#include "cs_basic.h"
#include "cs_string.h"
#include "cs_array.h"
#include "cs_hash.h"

namespace tool
{

  template <class c_key> unsigned int hash ( const c_key &the_key );

  template <class c_key,class c_element>
  class hash_table
  {
  public:
    hash_table ( size_t hash_size = 36 )
    {
      _hash_size = hash_size;
      _table = new array<hash_item> [ hash_size ];
    }

    virtual  ~hash_table()
    {
      clear ();
      delete [] _table;
    }

    bool  exists ( const c_key& the_key );

    //
    // Add to hash table association of object with specified name.
    //
    c_element&  operator[] ( const c_key &the_key );
    c_element&  get ( int the_index );

    //
    // Search for object with specified name in hash table.
    // If object is not found false is returned.
    //
    bool  find ( const c_key& the_key, c_element& the_element ) const;
    bool  find ( const c_key& the_key, c_element* &the_element_ptr ) const;

    //
    // Remove object with specified name from hash table.
    //
    c_element  remove ( const c_key& the_key );

    int   get_index ( const c_key& the_key, bool create );
    void  clear ();

    int
      size ()
    {
      return _array.size ();
    }

    bool
      is_empty ()
    {
      return _array.size () == 0;
    }

  protected:
    struct hash_item
    {
      c_key          _key;
      size_t         _index;

      hash_item () : _index ( 0 )
      {
      }

      hash_item ( const c_key& k, size_t i ) : _key ( k ), _index ( i )
      {
      }
    };
    size_t              _hash_size;
    array<hash_item> *  _table;

    array<c_element>    _array;
    c_element*          _get ( const c_key& the_key, bool create );

  public:
    const array<c_element>&
      elements () const
    {
      return _array;
    }
  };


  template <class c_key, class c_element>
  inline c_element&
    hash_table<c_key, c_element>::operator[] ( const c_key &the_key )
  {
    return *_get ( the_key, true );
  }

  template <class c_key, class c_element>
  inline bool
    hash_table<c_key, c_element>::find ( const c_key& the_key,
                                          c_element& the_element ) const
  {
    c_element *pe = const_cast<hash_table<c_key, c_element>*>
                    ( this )->_get ( the_key, false );
    if ( pe )
    {
      the_element = *pe;
      return true;
    }
    return false;
  }


  template <class c_key, class c_element>
  inline bool
    hash_table<c_key, c_element>::find ( const c_key& the_key,
                                          c_element* &the_element_ptr ) const
  {
    c_element *pe = const_cast<hash_table<c_key, c_element>*>
                    ( this )->_get ( the_key, false );
    if ( pe )
    {
      the_element_ptr = pe;
      return true;
    }
    return false;
  }


  template <class c_key, class c_element>
  inline c_element*
    hash_table<c_key, c_element>::_get ( const c_key& the_key, bool create )
  {
    int idx = get_index ( the_key, create );
    if ( idx < 0 )
      return 0;
    return &_array [ idx ];
  }

  template <class c_key, class c_element>
  inline int
    hash_table<c_key, c_element>::get_index ( const c_key& the_key,
                                              bool create )
  {
    size_t h = hash<c_key> ( the_key ) % _hash_size;
    int i;
    array<hash_item> &bucket = _table [ h ];

    for ( i = 0; i < bucket.size (); i++ )
    {
      const hash_item &it = bucket [ i ];
      if ( it._key == the_key )
        return it._index;
    }

    if ( create )
    {
      size_t ni = _array.size ();
      _array.size ( int ( ni + 1 ) );
      bucket.push ( hash_item ( the_key, ni ) );
      return ni;
    }
    return -1;
  }

  template <class c_key, class c_element>
  inline c_element
    hash_table<c_key, c_element>::remove ( const c_key& the_key )
  {
    size_t h = hash<c_key> ( the_key ) % _hash_size;
    c_element t;
    int i;
    array<hash_item> &bucket = _table [ h ];
    
    for ( i = 0; i < bucket.size(); i++ )
    {
      const hash_item &it = bucket [ i ];
      if ( it._key == the_key )
      {
        int index = it._index;
        t = _array.remove ( index );
        bucket.remove ( i );
        // adjust other references
        for ( h = 0; h < _hash_size; h++ )
        {
          array<hash_item> &bucket = _table [ h ];
          for ( i = 0; i < bucket.size(); i++ )
          {
            const hash_item &it = bucket [ i ];
            if ( it._index > index )
              it._index--;
          }
        }
        return t;
      }
    }
    return t;
  }


  template <class c_key, class c_element>
  inline c_element&
    hash_table<c_key, c_element>::get ( int the_index )
  {
    return _array [ the_index ];
  }

  template <class c_key, class c_element>
  inline bool
    hash_table<c_key, c_element>::exists ( const c_key& the_key )
  {
    return ( _get ( the_key, false ) != 0 );
  }

  template <class c_key, class c_element>
  inline void
    hash_table<c_key, c_element>::clear ()
  {
    for ( size_t i = 0; i < _hash_size; ++i )
      _table [ i ].clear ();
    _array.clear ();
  }

};

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
暴力调教一区二区三区| 欧美在线播放高清精品| 玉足女爽爽91| 久久精品视频一区| 欧美精品在欧美一区二区少妇| 九九久久精品视频| 日韩电影一区二区三区| 亚洲视频在线一区观看| www成人在线观看| 欧美一区二区美女| 91精品国产91久久久久久一区二区 | 久久av老司机精品网站导航| 亚洲bt欧美bt精品777| 亚洲mv在线观看| 日韩精品色哟哟| 美女在线一区二区| 韩国视频一区二区| 成人爽a毛片一区二区免费| 97精品国产97久久久久久久久久久久| 成人ar影院免费观看视频| 99re热这里只有精品视频| 在线欧美小视频| 欧美一级久久久| 欧美激情中文字幕一区二区| 亚洲人123区| 日韩主播视频在线| 国产成人免费网站| 日本韩国一区二区| 精品少妇一区二区三区在线播放| 久久久精品中文字幕麻豆发布| 国产日韩成人精品| 亚洲一区二区三区四区中文字幕| 人人狠狠综合久久亚洲| 99国产精品视频免费观看| 成人sese在线| 亚洲国产成人av网| 欧美调教femdomvk| 国产精品久久看| 国产高清一区日本| 亚洲精品一线二线三线| 亚洲福利国产精品| 欧美激情在线观看视频免费| 亚洲国产成人高清精品| 在线视频一区二区三区| 亚洲欧美另类图片小说| 亚洲精品成人悠悠色影视| 久久精品国产亚洲一区二区三区| 国产精品一线二线三线| 在线视频欧美精品| 国产欧美一二三区| 蜜桃av噜噜一区| jlzzjlzz亚洲日本少妇| 精品粉嫩aⅴ一区二区三区四区| 最新国产成人在线观看| 久久福利资源站| 欧美性受xxxx| 综合在线观看色| 福利一区二区在线观看| 欧美一区二区三区免费大片| 一区二区在线电影| 懂色av一区二区三区免费看| 欧美大黄免费观看| 欧美aaaaaa午夜精品| 欧美亚洲动漫制服丝袜| 亚洲伦在线观看| 99久久777色| 综合久久久久综合| 99久久99久久久精品齐齐| 国产视频一区二区在线| 国产精品羞羞答答xxdd| 久久婷婷国产综合国色天香 | 国产三级欧美三级| 蜜臀久久99精品久久久画质超高清| 在线观看国产精品网站| 一区二区三区在线免费视频| 99re66热这里只有精品3直播 | 99精品在线观看视频| 中文字幕高清一区| 成人免费视频一区| 欧美激情一区二区| av电影在线观看一区| 中文字幕在线不卡| 色哟哟精品一区| 亚洲精品伦理在线| 精品1区2区3区| 婷婷亚洲久悠悠色悠在线播放 | 午夜精品久久久久久久 | 老司机一区二区| 91久久人澡人人添人人爽欧美| 国产在线观看免费一区| 老司机免费视频一区二区| 韩国精品主播一区二区在线观看 | 日韩欧美国产一区二区三区| 6080午夜不卡| 日本一区二区视频在线观看| 免费av网站大全久久| 26uuu欧美日本| 不卡视频免费播放| 亚洲精品中文字幕在线观看| 欧美亚一区二区| 免费观看在线色综合| 精品国产91乱码一区二区三区| 美女视频黄频大全不卡视频在线播放 | 亚洲电影一级片| 91.com在线观看| 国产成+人+日韩+欧美+亚洲| 一色桃子久久精品亚洲| 欧美日韩国产一区| 狠狠色丁香久久婷婷综合_中| 国产精品看片你懂得| 欧美私人免费视频| 久久69国产一区二区蜜臀| 中文字幕一区二区视频| 欧美精品一二三| 国产a区久久久| 日本美女视频一区二区| 国产精品视频麻豆| 欧美一区二区三区在线| 成人91在线观看| 激情综合网激情| 亚洲影视资源网| 国产亚洲一区二区三区在线观看| 色国产精品一区在线观看| 另类人妖一区二区av| 又紧又大又爽精品一区二区| 久久亚洲春色中文字幕久久久| 日本丰满少妇一区二区三区| 国产一区二区三区日韩| 日韩一区欧美二区| 亚洲黄色小说网站| 国产欧美视频在线观看| 日韩欧美专区在线| 欧美日韩五月天| 成人高清视频在线观看| 麻豆精品在线播放| 亚洲高清视频在线| 国产精品国产精品国产专区不蜜 | 香蕉影视欧美成人| 国产精品护士白丝一区av| 精品久久久久99| 555夜色666亚洲国产免| 91天堂素人约啪| 粉嫩久久99精品久久久久久夜| 蜜桃视频免费观看一区| 婷婷久久综合九色国产成人| 一区二区激情视频| 亚洲男女毛片无遮挡| 国产欧美一区二区精品婷婷| 不卡的av网站| 秋霞av亚洲一区二区三| 国产精品久久久久久久裸模| 天堂蜜桃一区二区三区 | 天天综合天天做天天综合| 色老头久久综合| 久久精品国产久精国产| 一区二区免费看| 久久看人人爽人人| 欧美日韩一级片在线观看| 91麻豆自制传媒国产之光| 亚洲无线码一区二区三区| 国产精品视频你懂的| 国产精品免费观看视频| 久久综合九色综合欧美98| 欧美mv和日韩mv的网站| 欧美精品一区二区三区高清aⅴ | 日韩亚洲欧美中文三级| 欧美一区二区久久久| 日韩欧美亚洲一区二区| 精品久久国产字幕高潮| 久久久噜噜噜久久人人看 | 欧美mv日韩mv国产网站app| 欧美va亚洲va香蕉在线| 久久久久久久久久久99999| 国产日韩亚洲欧美综合| 国产精品福利影院| 亚洲愉拍自拍另类高清精品| 日韩成人伦理电影在线观看| 国产在线播放一区三区四| 国产成人精品综合在线观看| 99国产精品久久久久久久久久久| 91麻豆国产香蕉久久精品| 欧美日韩一区不卡| 欧美一区二区三区四区视频| 久久久久久久久岛国免费| 日韩理论电影院| 美国av一区二区| 91在线云播放| 日韩限制级电影在线观看| 国产精品每日更新在线播放网址| 亚洲制服欧美中文字幕中文字幕| 久久不见久久见中文字幕免费| 国产91精品在线观看| 欧美日韩一区二区三区不卡| 久久久噜噜噜久久人人看| 亚洲成人在线观看视频| 国产不卡免费视频| 日韩一区二区三区高清免费看看| 国产欧美精品区一区二区三区| 午夜a成v人精品| 99国产精品视频免费观看|