|
@@ -7,35 +7,21 @@
|
|
|
#include "hashed_string.hpp"
|
|
#include "hashed_string.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
|
-namespace entt {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * @brief Types identifiers.
|
|
|
|
|
- * @tparam Type Type for which to generate an identifier.
|
|
|
|
|
- */
|
|
|
|
|
-template<typename Type, typename = void>
|
|
|
|
|
-struct ENTT_API type_info {
|
|
|
|
|
- /**
|
|
|
|
|
- * @brief Returns the numeric representation of a given type.
|
|
|
|
|
- * @return The numeric representation of the given type.
|
|
|
|
|
- */
|
|
|
|
|
-#if defined ENTT_PRETTY_FUNCTION
|
|
|
|
|
- static constexpr ENTT_ID_TYPE id() ENTT_NOEXCEPT {
|
|
|
|
|
- return entt::hashed_string{ENTT_PRETTY_FUNCTION};
|
|
|
|
|
- }
|
|
|
|
|
|
|
+#ifdef ENTT_PRETTY_FUNCTION
|
|
|
|
|
+# define ENTT_TYPE_ID_API
|
|
|
#else
|
|
#else
|
|
|
- static ENTT_ID_TYPE id() ENTT_NOEXCEPT;
|
|
|
|
|
-};
|
|
|
|
|
|
|
+# define ENTT_TYPE_ID_API ENTT_API
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#ifndef ENTT_PRETTY_FUNCTION
|
|
|
/**
|
|
/**
|
|
|
* @cond TURN_OFF_DOXYGEN
|
|
* @cond TURN_OFF_DOXYGEN
|
|
|
* Internal details not to be documented.
|
|
* Internal details not to be documented.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
-namespace internal {
|
|
|
|
|
|
|
+namespace entt::internal {
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ENTT_API type_id_generator {
|
|
struct ENTT_API type_id_generator {
|
|
@@ -53,12 +39,31 @@ struct ENTT_API type_id_generator {
|
|
|
* Internal details not to be documented.
|
|
* Internal details not to be documented.
|
|
|
* @endcond TURN_OFF_DOXYGEN
|
|
* @endcond TURN_OFF_DOXYGEN
|
|
|
*/
|
|
*/
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
-template<typename Type, typename Cond>
|
|
|
|
|
-ENTT_ID_TYPE type_info<Type, Cond>::id() ENTT_NOEXCEPT {
|
|
|
|
|
- static const ENTT_ID_TYPE value = internal::type_id_generator::next();
|
|
|
|
|
- return value;
|
|
|
|
|
|
|
+namespace entt {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief Types identifiers.
|
|
|
|
|
+ * @tparam Type Type for which to generate an identifier.
|
|
|
|
|
+ */
|
|
|
|
|
+template<typename Type, typename = void>
|
|
|
|
|
+struct ENTT_TYPE_ID_API type_info {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Returns the numeric representation of a given type.
|
|
|
|
|
+ * @return The numeric representation of the given type.
|
|
|
|
|
+ */
|
|
|
|
|
+#ifdef ENTT_PRETTY_FUNCTION
|
|
|
|
|
+ static constexpr ENTT_ID_TYPE id() ENTT_NOEXCEPT {
|
|
|
|
|
+ return entt::hashed_string{ENTT_PRETTY_FUNCTION};
|
|
|
|
|
+ }
|
|
|
|
|
+#else
|
|
|
|
|
+ static ENTT_ID_TYPE id() ENTT_NOEXCEPT {
|
|
|
|
|
+ static const ENTT_ID_TYPE value = internal::type_id_generator::next();
|
|
|
|
|
+ return value;
|
|
|
|
|
+ }
|
|
|
#endif
|
|
#endif
|
|
|
};
|
|
};
|
|
|
|
|
|