OverSim
__gnu_cxx::hash< IPvXAddress > Struct Template Reference

defines a hash function for IPvXAddress More...

#include <HashFunc.h>

Public Member Functions

std::size_t operator() (const IPvXAddress &addr) const
 hash function for IPvXaddress

Detailed Description

template<>
struct __gnu_cxx::hash< IPvXAddress >

defines a hash function for IPvXAddress

Definition at line 42 of file HashFunc.h.

Member Function Documentation

std::size_t __gnu_cxx::hash< IPvXAddress >::operator() ( const IPvXAddress &  addr) const
inline

hash function for IPvXaddress

Parameters
addrthe IPvXAddress to hash
Returns
the hashed IPvXAddress

Definition at line 50 of file HashFunc.h.

{
if (addr.isIPv6()) {
return ((bswap_32(addr.get6().words()[0])) ^
(bswap_32(addr.get6().words()[1])) ^
(bswap_32(addr.get6().words()[2])) ^
(bswap_32(addr.get6().words()[3])));
} else {
return bswap_32(addr.get4().getInt());
}
}

The documentation for this struct was generated from the following file: