28 #include <unordered_map> 31 #include <wx/string.h> 36 struct iequal_to : std::binary_function< const char*, const char*, bool >
40 return !strcmp( x, y );
67 std::size_t hash = 2166136261u;
71 hash ^= (
unsigned char) *it;
84 std::size_t hash = 2166136261u;
86 for(
const wxUniChar c : aString )
88 unsigned ch = static_cast<unsigned>( c );
98 #define DECL_HASH_FOR_SWIG( TypeName, KeyType, ValueType ) \ 102 % template( TypeName ) unordered_map<KeyType, ValueType>; \ 104 typedef std::unordered_map<KeyType, ValueType> TypeName; 106 #define DECL_HASH_FOR_SWIG( TypeName, KeyType, ValueType ) \ 108 typedef std::unordered_map<KeyType, ValueType> TypeName; 129 typedef std::unordered_map< const char*, int, fnv_1a, iequal_to >
KEYWORD_MAP;
133 typedef std::unordered_map< std::string, EDA_RECT >
RECT_MAP;
136 #endif // HASHTABLES_H_ std::size_t operator()(const wxString &aString) const
Equality test for "const char*" type used in very specialized KEYWORD_MAP below.
std::unordered_map< const char *, int, fnv_1a, iequal_to > KEYWORD_MAP
A hashtable made of a const char* and an int.
bool operator()(const char *x, const char *y) const
Hash function for wxString, counterpart of std::string hash.
std::size_t operator()(const char *it) const
Very fast and efficient hash function for "const char*" type, used in specialized KEYWORD_MAP below.
std::unordered_map< std::string, EDA_RECT > RECT_MAP
Map a C string to an EDA_RECT.