[click] usage of bighashmap in Click

Eddie Kohler kohler at cs.ucla.edu
Mon Mar 14 12:21:13 EST 2005


Hi Hao,

> I found the use of bighashmap in SpinlockInfo the thing confuses me is 
> SpinlockInfo::SpinlockInfo():_map(-1). I guess the constructor been 
> called
> is HashMap(const HashMap<K, V> &); is that correct? What does _map(-1) 
> initialize?

The "-1" is the default value: what is returned by ::find(K) when K is 
not in the HashMap.

> Since HashMap uses template, I put  HashMap<unsigned, unsigned> 
> _statistics; in my element class header file. Then I got
>
> /elements/standard/smartqueue.cc:12: undefined reference to 
> `HashMap<unsigned int, unsigned int>::~HashMap(void)'
>
> If I copy HashMap<String, int> _map; then there is no error.

As others have kindly explained, you need to add "#include 
<click/hashmap.cc>" to your source file.  You can put it anywhere you 
like.

Eddie


>
> Thank you Eddi and Tolja for the previous replies. I really appreciate 
> that.
> Kind regards
> Alan
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click



More information about the click mailing list