[Click] Questions about HashMap

Xiaojun Feng fightfxj at gmail.com
Fri Mar 27 03:15:54 EDT 2009


Thanks very much for your reply!

I have tried to use HashTable. But I can't find hashtable.hh in my click,
the version I am using is 1.6.

Now I just use two Vectors to achieve the same function.

On Fri, Mar 27, 2009 at 2:35 PM, Eddie Kohler <kohler at cs.ucla.edu> wrote:

> (1) This is not a question.
> (2) HashMap should not be used in new code; use HashTable.
>
> Eddie
>
>
>
> Xiaojun Feng wrote:
>
>> Hi all,
>>
>> I have an question about HashMap in Click.
>>
>> I defined a HashMap as follows:
>>
>> class DataType
>> {
>> public:
>>      DataType(uint8_t* data, uint32_t size) : data(data), size(size) {}
>>      ~DataType() {delete[] data;}
>>      const uint8_t * GetData() {return data}
>>
>> private:
>>      uint8_t* data;
>>      uint32_t size;
>> }
>>
>> typedef HashMap<uint32_t, DataPtr> DataMap
>>
>>


-- 
Xiaojun Feng


More information about the click mailing list