DoorKeeper/include/doorkeeper/implem/hashing.inl
King_DuckZ fd8a1cbabc Add a hash mechanism to BaseMapSource.
This is needed to recognize what type of tiles a layer contains.
Client code has to fill in a map of hash => add_layer<T>() pointers.
As a layer is loaded, the correct add_layer<T>() is called based
on the hash saved with the layer itself.
2015-06-07 03:57:18 +02:00

15 lines
492 B
C++

namespace dk {
template <typename T, uint32_t D>
HashType make_signature_hash() {
#if defined(__GNUC__)
//TODO: use bt::string if possible
const char* const pf = __PRETTY_FUNCTION__;
const std::size_t len = sizeof(__PRETTY_FUNCTION__) - 1;
//constexpr bt::string<sizeof(__PRETTY_FUNCTION__)-1> func_pretty(pf);
#else
# error "Unknown compiler"
#endif
//return implem::hash_string(func_pretty.data(), func_pretty.size());
return implem::hash_string(pf, len);
}
} //namespace dk