[Click] hashcode confusion

Bart Braem bart.braem at ua.ac.be
Fri Nov 6 07:37:33 EST 2009


On 05 Nov 2009, at 12:19, Alastair McKinley wrote:

> inline size_t EtherPair::hashcode() const {
>    return CLICK_NAME(hashcode)(_src) + CLICK_NAME(hashcode)(_dst);
>
> }
>
> Can someone explain how the hashcode member function works in the  
> this example?


Sure.
CLICK_NAME(name) is a macro to do scoping, especially in the ns  
version of Click. In all other cases, it generates ::name
So after macro processing, the line reads:
return ::hashcode(_src) + ::hashcode(_dst);
and those calls are on the hashcode method of EtherAddress, which can  
be found in include/click/etheraddress.hh

Regards,
Bart Braem
-- 
Bart Braem
PATS research group - IBBT
Dept. of Mathematics and Computer Sciences
University of Antwerp
Campus Middelheim, G3.27
Middelheimlaan 1
B-2020 Antwerpen, Belgium
Phone: +32 (0)3 265.38.82
Fax: +32 (0)3 265.37.77
Web: www.pats.ua.ac.be



More information about the click mailing list