Forráskód Böngészése

Updating the Uuid class to be constexpr (#11810)

* Adding more implementations of range algorithms

C++23 ranges::iota has been added
C++20 ranges::lexicographical_compare and ranges::transform has been
added

Signed-off-by: lumberyard-employee-dm <[email protected]>

* Updating the Uuid class to be constexpr

resolves #10861

Signed-off-by: lumberyard-employee-dm <[email protected]>

* Updated the TypeInfo class to be constexpr

Fixed up all source locations to use the updated Uuid API.
Such changes include integer value of 0 or `nullptr` is no longer
convertible to a Uuid.
A string literal with a Uuid format string has to use the explicit Uuid
string_view constructor.

The `data` member of the Uuid class is no longer public and now
`AZStd::ranges::data` must be used to access for advanced access.

Signed-off-by: lumberyard-employee-dm <[email protected]>

* Updating the char conversion functions to use std::locale

Added an AZStd version of tolower and toupper that uses std::locale.

Added a range based version of the `AZStd::to_lower/to_upper` extension.

Updated the AssetRegistry to transform the supplied path on the fly.

Signed-off-by: lumberyard-employee-dm <[email protected]>

Signed-off-by: lumberyard-employee-dm <[email protected]>
lumberyard-employee-dm 3 éve
szülő
commit
fb022b79ae
100 módosított fájl, 2231 hozzáadás és 1715 törlés
  1. 2 2
      AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py
  2. 2 2
      AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/mock_asset_builder.py
  3. 1 1
      AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/EmptyInstanceSpawner_EmptySpawnerWorks.py
  4. 2 4
      Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.h
  5. 1 1
      Code/Editor/Lib/Tests/test_AzAssetBrowserRequestHandler.cpp
  6. 1 1
      Code/Framework/AtomCore/AtomCore/Instance/InstanceId.cpp
  7. 2 0
      Code/Framework/AzCore/AzCore/Asset/AssetCommon.cpp
  8. 6 1
      Code/Framework/AzCore/AzCore/Asset/AssetCommon.h
  9. 4 4
      Code/Framework/AzCore/AzCore/Asset/AssetSerializer.h
  10. 3 3
      Code/Framework/AzCore/AzCore/Component/Component.h
  11. 2 2
      Code/Framework/AzCore/AzCore/Component/TransformBus.h
  12. 1 1
      Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp
  13. 1 1
      Code/Framework/AzCore/AzCore/DOM/DomUtils.h
  14. 1 1
      Code/Framework/AzCore/AzCore/IO/GenericStreams.cpp
  15. 3 15
      Code/Framework/AzCore/AzCore/Math/MathReflection.cpp
  16. 4 5
      Code/Framework/AzCore/AzCore/Math/MathScriptHelpers.cpp
  17. 50 50
      Code/Framework/AzCore/AzCore/Math/Sha1.h
  18. 32 388
      Code/Framework/AzCore/AzCore/Math/Uuid.cpp
  19. 93 92
      Code/Framework/AzCore/AzCore/Math/Uuid.h
  20. 491 0
      Code/Framework/AzCore/AzCore/Math/Uuid.inl
  21. 2 75
      Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp
  22. 2 2
      Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.cpp
  23. 2 2
      Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h
  24. 43 43
      Code/Framework/AzCore/AzCore/RTTI/RTTI.h
  25. 271 287
      Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h
  26. 1 1
      Code/Framework/AzCore/AzCore/RTTI/TypeInfoSimple.h
  27. 1 1
      Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp
  28. 2 1
      Code/Framework/AzCore/AzCore/Script/ScriptContext.h
  29. 9 9
      Code/Framework/AzCore/AzCore/Script/ScriptProperty.cpp
  30. 11 11
      Code/Framework/AzCore/AzCore/Script/ScriptProperty.h
  31. 33 33
      Code/Framework/AzCore/AzCore/Script/ScriptPropertyTable.h
  32. 117 117
      Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl
  33. 10 10
      Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp
  34. 18 18
      Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h
  35. 2 1
      Code/Framework/AzCore/AzCore/Serialization/Utils.h
  36. 4 4
      Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl
  37. 6 6
      Code/Framework/AzCore/AzCore/Settings/ConfigurableStack.h
  38. 5 5
      Code/Framework/AzCore/AzCore/Settings/ConfigurableStack.inl
  39. 1 0
      Code/Framework/AzCore/AzCore/azcore_files.cmake
  40. 70 0
      Code/Framework/AzCore/AzCore/base.h
  41. 234 5
      Code/Framework/AzCore/AzCore/std/ranges/ranges_algorithm.h
  42. 59 56
      Code/Framework/AzCore/AzCore/std/string/conversions.h
  43. 1 1
      Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/azcore.natvis
  44. 1 1
      Code/Framework/AzCore/Platform/Windows/AzCore/Platform_Windows.cpp
  45. 88 0
      Code/Framework/AzCore/Tests/AZStd/RangesAlgorithmTests.cpp
  46. 12 12
      Code/Framework/AzCore/Tests/Asset/AssetManagerLoadingTests.cpp
  47. 2 2
      Code/Framework/AzCore/Tests/Components.cpp
  48. 1 1
      Code/Framework/AzCore/Tests/EntityTests.cpp
  49. 41 0
      Code/Framework/AzCore/Tests/Rtti.cpp
  50. 14 14
      Code/Framework/AzCore/Tests/Serialization.cpp
  51. 5 5
      Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp
  52. 1 0
      Code/Framework/AzCore/Tests/Time/TimeTests.cpp
  53. 159 106
      Code/Framework/AzCore/Tests/UUIDTests.cpp
  54. 12 23
      Code/Framework/AzFramework/AzFramework/Asset/AssetRegistry.cpp
  55. 1 1
      Code/Framework/AzFramework/AzFramework/Asset/SimpleAsset.h
  56. 2 2
      Code/Framework/AzFramework/AzFramework/Components/CameraBus.h
  57. 1 1
      Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp
  58. 2 2
      Code/Framework/AzFramework/AzFramework/DocumentPropertyEditor/DocumentSchema.h
  59. 1 1
      Code/Framework/AzFramework/AzFramework/Physics/Configuration/SimulatedBodyConfiguration.cpp
  60. 1 1
      Code/Framework/AzFramework/AzFramework/Physics/Material/PhysicsMaterialId.cpp
  61. 1 1
      Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp
  62. 1 1
      Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.cpp
  63. 3 3
      Code/Framework/AzFramework/Tests/BehaviorEntityTests.cpp
  64. 1 1
      Code/Framework/AzFramework/Tests/Scene.cpp
  65. 6 0
      Code/Framework/AzTest/AzTest/Printers.cpp
  66. 3 0
      Code/Framework/AzTest/AzTest/Printers.h
  67. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetSeedManager.cpp
  68. 2 2
      Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp
  69. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/EditorPrefabComponent.h
  70. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.cpp
  71. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.h
  72. 4 4
      Code/Framework/AzToolsFramework/AzToolsFramework/SQLite/SQLiteConnection.cpp
  73. 2 2
      Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/GenericComponentWrapper.cpp
  74. 2 2
      Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/GenericComponentWrapper.h
  75. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/SelectionComponent.cpp
  76. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/UIFramework.cpp
  77. 2 2
      Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp
  78. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx
  79. 2 4
      Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h
  80. 2 2
      Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h
  81. 1 1
      Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/SharedViewBookmarkComponent.h
  82. 2 2
      Code/Framework/AzToolsFramework/Tests/GenericComponentWrapperTest.cpp
  83. 2 2
      Code/Framework/AzToolsFramework/Tests/Script/ScriptComponentTests.cpp
  84. 2 2
      Code/Framework/AzToolsFramework/Tests/SliceUpgradeTests.cpp
  85. 5 5
      Code/Framework/AzToolsFramework/Tests/SliceUpgradeTestsData.h
  86. 5 5
      Code/Framework/AzToolsFramework/Tests/Viewport/ViewportEditorModeTests.cpp
  87. 6 6
      Code/Legacy/CryCommon/Maestro/Bus/SequenceComponentBus.h
  88. 4 4
      Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp
  89. 22 24
      Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp
  90. 1 1
      Code/Tools/AssetProcessor/native/tests/AssetCatalog/AssetCatalogUnitTests.cpp
  91. 2 2
      Code/Tools/AssetProcessor/native/unittests/AssetProcessorManagerUnitTests.cpp
  92. 1 2
      Code/Tools/AssetProcessor/native/unittests/BuilderSDKUnitTests.cpp
  93. 1 1
      Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp
  94. 1 1
      Code/Tools/LuaIDE/Source/LUA/WatchesPanel.cpp
  95. 1 1
      Code/Tools/SceneAPI/SDKWrapper/AssImpMaterialWrapper.cpp
  96. 1 1
      Code/Tools/SceneAPI/SDKWrapper/AssImpNodeWrapper.cpp
  97. 4 7
      Code/Tools/SceneAPI/SceneCore/DataTypes/DataTypeUtilities.cpp
  98. 5 5
      Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/PresetSettings.h
  99. 3 4
      Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.cpp
  100. 174 174
      Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CCubeMapProcessor.cpp

+ 2 - 2
AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py

@@ -15,7 +15,7 @@ handler = azlmbr.editor.EditorEventBusHandler()
 def on_notify_editor_initialized(args):
     # These tests are meant to check that the test_asset.mock source asset turned into
     # a test_asset.mock_asset product asset via the Python asset builder system
-    mockAssetType = azlmbr.math.Uuid_CreateString('{9274AD17-3212-4651-9F3B-7DCCB080E467}', 0)
+    mockAssetType = azlmbr.math.Uuid_CreateString('{9274AD17-3212-4651-9F3B-7DCCB080E467}')
     mockAssetPath = 'gem/pythontests/pythonassetbuilder/test_asset.mock_asset'
     assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', mockAssetPath, mockAssetType, False)
     if (assetId.is_valid() is False):
@@ -33,7 +33,7 @@ def on_notify_editor_initialized(args):
 
     # These tests detect if the geom_group.fbx file turns into a number of azmodel product assets
     def test_azmodel_product(generatedModelAssetPath):
-        azModelAssetType = azlmbr.math.Uuid_CreateString('{2C7477B6-69C5-45BE-8163-BCD6A275B6D8}', 0)
+        azModelAssetType = azlmbr.math.Uuid_CreateString('{2C7477B6-69C5-45BE-8163-BCD6A275B6D8}')
         assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', generatedModelAssetPath, azModelAssetType, False)
         assetIdString = assetId.to_string()
         if (assetId.is_valid()):

+ 2 - 2
AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/mock_asset_builder.py

@@ -62,7 +62,7 @@ def process_file(request):
 
     # generate a product asset file entry
     subId = binascii.crc32(mockFilename.encode())
-    mockAssetType = azlmbr.math.Uuid_CreateString('{9274AD17-3212-4651-9F3B-7DCCB080E467}', 0)
+    mockAssetType = azlmbr.math.Uuid_CreateString('{9274AD17-3212-4651-9F3B-7DCCB080E467}')
     product = azlmbr.asset.builder.JobProduct(mockFilename, mockAssetType, subId)
     product.dependenciesHandled = True
     productOutputs = []
@@ -109,7 +109,7 @@ def register_asset_builder(busId):
 
 # create the asset builder handler
 busIdString = '{CF5C74C1-9ED4-5851-95B1-0B15090DBEC7}'
-busId = azlmbr.math.Uuid_CreateString(busIdString, 0)
+busId = azlmbr.math.Uuid_CreateString(busIdString)
 handler = None
 try:
     handler = register_asset_builder(busId)

+ 1 - 1
AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/EmptyInstanceSpawner_EmptySpawnerWorks.py

@@ -61,7 +61,7 @@ def EmptyInstanceSpawner_EmptySpawnerWorks():
     general.set_current_view_position(512.0, 480.0, 38.0)
 
     # Grab the UUID that we need for creating an Empty Spawner
-    empty_spawner_uuid = azlmbr.math.Uuid_CreateString('{23C40FD4-A55F-4BD3-BE5B-DC5423F217C2}', 0)
+    empty_spawner_uuid = azlmbr.math.Uuid_CreateString('{23C40FD4-A55F-4BD3-BE5B-DC5423F217C2}')
 
     # 2) Test EmptyInstanceSpawner BehaviorContext
     behavior_context_test_success = True

+ 2 - 4
Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.h

@@ -388,11 +388,9 @@ public:
     AZ_RTTI(CReflectedVarMotion, "{66397EFB-620A-40B8-8C66-D6AECF690DF5}", CReflectedVar)
 
     CReflectedVarMotion(const AZStd::string& name)
-        : CReflectedVar(name)
-        , m_assetId(0) {}
+        : CReflectedVar(name) {}
 
-    CReflectedVarMotion()
-        : m_assetId(0) {}
+    CReflectedVarMotion() = default;
 
     AZStd::string varName() const { return m_varName; }
     AZStd::string description() const { return m_description; }

+ 1 - 1
Code/Editor/Lib/Tests/test_AzAssetBrowserRequestHandler.cpp

@@ -44,7 +44,7 @@ namespace UnitTest
     class MockEditorComponent : public AzToolsFramework::Components::EditorComponentBase
     {
     public:
-        static constexpr const char* const s_MockEditorComponentTypeId = "{1D01FB53-1453-4250-A561-B2A657816B03}";
+        static inline constexpr AZ::TypeId s_MockEditorComponentTypeId{ "{1D01FB53-1453-4250-A561-B2A657816B03}" };
         AZ_COMPONENT(MockEditorComponent, s_MockEditorComponentTypeId, AzToolsFramework::Components::EditorComponentBase);
 
         void SetPrimaryAsset(const AZ::Data::AssetId& assetId) override

+ 1 - 1
Code/Framework/AtomCore/AtomCore/Instance/InstanceId.cpp

@@ -32,7 +32,7 @@ namespace AZ
 
         InstanceId InstanceId::CreateData(const void* data, size_t dataSize)
         {
-            return InstanceId(Uuid::CreateData(data, dataSize));
+            return InstanceId(Uuid::CreateData(reinterpret_cast<const AZStd::byte*>(data), dataSize));
         }
 
         InstanceId InstanceId::CreateRandom()

+ 2 - 0
Code/Framework/AzCore/AzCore/Asset/AssetCommon.cpp

@@ -70,11 +70,13 @@ namespace AZ::Data
                 ->Attribute(AZ::Script::Attributes::Module, "asset")
                 ->Constructor()
                 ->Constructor<const Uuid&, u32>()
+                ->Constructor<AZStd::string_view, u32>()
                 ->Method("CreateString", &Data::AssetId::CreateString)
                 ->Method("IsValid", &Data::AssetId::IsValid)
                     ->Attribute(AZ::Script::Attributes::Alias, "is_valid")
                 ->Method("ToString", [](const Data::AssetId* self) { return self->ToString<AZStd::string>(); })
                     ->Attribute(AZ::Script::Attributes::Alias, "to_string")
+                    ->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
                 ->Method("IsEqual", [](const Data::AssetId& self, const Data::AssetId& other) { return self == other; })
                     ->Attribute(AZ::Script::Attributes::Alias, "is_equal")
                     ->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::Equal)

+ 6 - 1
Code/Framework/AzCore/AzCore/Asset/AssetCommon.h

@@ -58,6 +58,7 @@ namespace AZ
 
             /// Create asset id in invalid state
             AssetId();
+            explicit AssetId(AZStd::string_view guidString, u32 subId = 0);
             AssetId(const Uuid& guid, u32 subId = 0);
 
             bool IsValid() const;
@@ -160,7 +161,7 @@ namespace AZ
             bool IsLoading(bool includeQueued = true) const;
             AssetStatus GetStatus() const { return m_status.load(); }
             const AssetId& GetId() const { return m_assetId; }
-            const AssetType& GetType() const { return RTTI_GetType(); }
+            AssetType GetType() const { return RTTI_GetType(); }
             int GetUseCount() const { return m_useCount.load(); }
             int GetCreationToken() const { return m_creationToken; }
 
@@ -697,6 +698,10 @@ namespace AZ
         }
 
         //=========================================================================
+        inline AssetId::AssetId(AZStd::string_view guidString, u32 subId)
+            : AssetId(AZ::Uuid(guidString), subId)
+        {
+        }
         inline AssetId::AssetId(const Uuid& guid, u32 subId)
             : m_guid(guid)
             , m_subId(subId)

+ 4 - 4
Code/Framework/AzCore/AzCore/Asset/AssetSerializer.h

@@ -152,18 +152,18 @@ namespace AZ {
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ThisType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return GetAssetClassId();
             }
@@ -200,7 +200,7 @@ namespace AZ {
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ThisType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->m_classData.m_typeId;
         }

+ 3 - 3
Code/Framework/AzCore/AzCore/Component/Component.h

@@ -109,7 +109,7 @@ namespace AZ
         * to the wrapped component's ID.
         * @return The type ID of the component.
         */
-        virtual const TypeId& GetUnderlyingComponentType() const { return RTTI_GetType(); }
+        virtual TypeId GetUnderlyingComponentType() const { return RTTI_GetType(); }
 
         /**
          * Sets the component ID.
@@ -349,7 +349,7 @@ namespace AZ
          * Gets the ID of the component.
          * @return Returns a pointer to the component ID.
          */
-        virtual const Uuid& GetUuid() const = 0;
+        virtual Uuid GetUuid() const = 0;
 
         /**
          * Reflects component data into a variety of contexts (script, serialize, edit, and so on).
@@ -484,7 +484,7 @@ namespace AZ
          * Gets the ID of the component.
          * @return Returns a pointer to the component ID.
          */
-        const Uuid& GetUuid() const override
+        Uuid GetUuid() const override
         {
             return AzTypeInfo<ComponentClass>::Uuid();
         }

+ 2 - 2
Code/Framework/AzCore/AzCore/Component/TransformBus.h

@@ -344,10 +344,10 @@ namespace AZ
     using TransformNotificationBus = AZ::EBus<TransformNotification>;
 
     //! The typeId of game component AzFramework::TransformComponent.
-    static const TypeId TransformComponentTypeId = "{22B10178-39B6-4C12-BB37-77DB45FDD3B6}";
+    static constexpr TypeId TransformComponentTypeId{ AZStd::string_view("{22B10178-39B6-4C12-BB37-77DB45FDD3B6}") };
 
     //! The typeId of editor component AzToolsFramework::Components::TransformComponent.
-    static const TypeId EditorTransformComponentTypeId = "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0}";
+    static constexpr TypeId EditorTransformComponentTypeId{ AZStd::string_view("{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0}") };
 
     //! Component configuration for the transform component.
     class TransformConfig

+ 1 - 1
Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp

@@ -328,7 +328,7 @@ namespace AZ::Dom::Utils
         return result;
     }
 
-    const AZ::TypeId& GetValueTypeId(const Dom::Value& value)
+    AZ::TypeId GetValueTypeId(const Dom::Value& value)
     {
         switch (value.GetType())
         {

+ 1 - 1
Code/Framework/AzCore/AzCore/DOM/DomUtils.h

@@ -149,7 +149,7 @@ namespace AZ::Dom::Utils
         }
     }
 
-    const AZ::TypeId& GetValueTypeId(const Dom::Value& value);
+    AZ::TypeId GetValueTypeId(const Dom::Value& value);
 
     template<typename T>
     bool CanConvertValueToType(const Dom::Value& value)

+ 1 - 1
Code/Framework/AzCore/AzCore/IO/GenericStreams.cpp

@@ -37,7 +37,7 @@ namespace AZ::IO
             {
                 // Read in the appropriate number of bytes on every loop iteration.
                 // (ex:  515 bytes requested will read 256 bytes, 256 bytes, and 3 bytes)
-                SizeType transferBytes = AZ::GetMin(bytes - windowOffset, aznumeric_cast<SizeType>(StreamToStreamCopyBufferSize));
+                SizeType transferBytes = AZStd::GetMin(bytes - windowOffset, aznumeric_cast<SizeType>(StreamToStreamCopyBufferSize));
 
                 SizeType bytesRead = inputStream->Read(transferBytes, tempBuffer);
                 if (bytesRead > 0)

+ 3 - 15
Code/Framework/AzCore/AzCore/Math/MathReflection.cpp

@@ -132,18 +132,6 @@ namespace AZ
             }
         }
 
-        //////////////////////////////////////////////////////////////////////////
-        AZStd::string UuidToString(const Uuid& id)
-        {
-            char buffer[64];
-            AZStd::string result;
-            if (id.ToString(buffer, AZ_ARRAY_SIZE(buffer)))
-            {
-                result = buffer;
-            }
-            return result;
-        }
-
         /**
          * Script Wrapper for Crc32
          */
@@ -300,7 +288,7 @@ namespace AZ
             Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)->
             Attribute(AZ::Script::Attributes::ConstructorOverride, &Internal::ScriptUuidConstructor)->
             Attribute(AZ::Script::Attributes::GenericConstructorOverride, &Internal::UuidDefaultConstructor)->
-            Method("ToString", &Internal::UuidToString)->
+            Method("ToString", [](const Uuid* self) { return self->ToString<AZStd::string>(); })->
                 Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)->
             Method("LessThan", &Uuid::operator<)->
                 Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::LessThan)->
@@ -314,10 +302,10 @@ namespace AZ
                 Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)->
             Method("CreateNull", &Uuid::CreateNull)->
                 Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)->
-            Method("CreateString", &Uuid::CreateString)->
+            Method("CreateString", [](AZStd::string_view uuidString) { return Uuid::CreateString(uuidString); })->
                 Attribute(AZ::Script::Attributes::MethodOverride, &Internal::UuidCreateStringGeneric)->
                 Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)->
-            Method("CreateName", &Uuid::CreateName)->
+            Method("CreateName", [](AZStd::string_view nameString) { return Uuid::CreateName(nameString); })->
                 Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)->
             Method("CreateRandom", &Uuid::CreateRandom);
 

+ 4 - 5
Code/Framework/AzCore/AzCore/Math/MathScriptHelpers.cpp

@@ -55,7 +55,7 @@ namespace AZ
 
         const Uuid* uuidPtr = reinterpret_cast<const Uuid*>(classPtr);
 
-        return static_cast<size_t>(stream.Write(16, reinterpret_cast<const void*>(uuidPtr->data)));
+        return static_cast<size_t>(stream.Write(AZStd::ranges::size(*uuidPtr), AZStd::ranges::data(*uuidPtr)));
     }
 
 
@@ -69,8 +69,7 @@ namespace AZ
         }
 
         Uuid value;
-        void* dataPtr = reinterpret_cast<void*>(&value.data);
-        in.Read(16, dataPtr);
+        in.Read(AZStd::ranges::size(value), AZStd::ranges::data(value));
 
         char str[128];
         value.ToString(str, 128);
@@ -88,7 +87,7 @@ namespace AZ
 
         Uuid uuid = Uuid::CreateString(text);
         stream.Seek(0, IO::GenericStream::ST_SEEK_BEGIN);
-        return static_cast<size_t>(stream.Write(16, uuid.data));
+        return static_cast<size_t>(stream.Write(AZStd::ranges::size(uuid), AZStd::ranges::data(uuid)));
     }
 
 
@@ -103,7 +102,7 @@ namespace AZ
         }
 
         Uuid* uuidPtr = reinterpret_cast<Uuid*>(classPtr);
-        if (stream.Read(GuidSizeBytes, reinterpret_cast<void*>(&uuidPtr->data)) == GuidSizeBytes)
+        if (stream.Read(GuidSizeBytes, reinterpret_cast<void*>(AZStd::ranges::data(*uuidPtr))) == GuidSizeBytes)
         {
             return true;
         }

+ 50 - 50
Code/Framework/AzCore/AzCore/Math/Sha1.h

@@ -10,46 +10,49 @@
 #pragma once
 
 #include <AzCore/base.h>
+#include <AzCore/std/containers/span.h>
 
 namespace AZ
 {
     class Sha1
     {
     public:
-        typedef AZ::u32(&DigestType)[5];
+        using DigestType = AZ::u32(&)[5];
 
-        Sha1();
+        constexpr Sha1() = default;
 
-        void Reset();
+        constexpr void Reset();
 
-        void ProcessByte(unsigned char byte);
-        void ProcessBlock(void const* bytesBegin, void const* bytesEnd);
-        void ProcessBytes(void const* buffer, size_t byteCount);
+        constexpr void ProcessByte(AZStd::byte byte);
+        constexpr void ProcessBytes(AZStd::span<AZStd::byte const> byteSpan);
+        constexpr void ProcessBytes(AZStd::byte const* buffer, size_t byteCount);
 
-        void GetDigest(DigestType digest);
+        constexpr void GetDigest(DigestType digest);
 
     private:
-        void ProcessBlock();
+        constexpr void ProcessBlock();
 
-        AZ_FORCE_INLINE AZ::u32 LeftRotate(AZ::u32 x, size_t n)
+        AZ_FORCE_INLINE constexpr AZ::u32 LeftRotate(AZ::u32 x, size_t n)
         {
             return (x << n) ^ (x >> (32 - n));
         }
 
-        AZ::u32 m_h[5];
+        AZ::u32 m_h[5]
+        {
+            0x67452301,
+            0xEFCDAB89,
+            0x98BADCFE,
+            0x10325476,
+            0xC3D2E1F0
+        };
 
-        unsigned char m_block[64];
+        AZStd::byte m_block[64]{ AZStd::byte{} };
 
-        size_t m_blockByteIndex;
-        size_t m_byteCount;
+        size_t m_blockByteIndex{};
+        size_t m_byteCount{};
     };
 
-    inline Sha1::Sha1()
-    {
-        Reset();
-    }
-
-    inline void Sha1::Reset()
+    inline constexpr void Sha1::Reset()
     {
         m_h[0] = 0x67452301;
         m_h[1] = 0xEFCDAB89;
@@ -61,7 +64,7 @@ namespace AZ
         m_byteCount = 0;
     }
 
-    inline void Sha1::ProcessByte(unsigned char byte)
+    inline constexpr void Sha1::ProcessByte(AZStd::byte byte)
     {
         m_block[m_blockByteIndex++] = byte;
         ++m_byteCount;
@@ -72,31 +75,28 @@ namespace AZ
         }
     }
 
-    inline void Sha1::ProcessBlock(void const* bytesBegin, void const* bytesEnd)
+    inline constexpr void Sha1::ProcessBytes(AZStd::span<AZStd::byte const> byteSpan)
     {
-        unsigned char const* begin = static_cast<unsigned char const*>(bytesBegin);
-        unsigned char const* end = static_cast<unsigned char const*>(bytesEnd);
-        for (; begin != end; ++begin)
+        for (AZStd::byte byteElement : byteSpan)
         {
-            ProcessByte(*begin);
+            ProcessByte(byteElement);
         }
     }
 
-    inline void Sha1::ProcessBytes(void const* buffer, size_t byteCount)
+    inline constexpr void Sha1::ProcessBytes(AZStd::byte const* buffer, size_t byteCount)
     {
-        unsigned char const* b = static_cast<unsigned char const*>(buffer);
-        ProcessBlock(b, b + byteCount);
+        ProcessBytes({ buffer, byteCount });
     }
 
-    inline void Sha1::ProcessBlock()
+    inline constexpr void Sha1::ProcessBlock()
     {
-        AZ::u32 w[80];
+        AZ::u32 w[80]{ 0 };
         for (size_t i = 0; i < 16; ++i)
         {
-            w[i] = (m_block[i * 4 + 0] << 24);
-            w[i] |= (m_block[i * 4 + 1] << 16);
-            w[i] |= (m_block[i * 4 + 2] << 8);
-            w[i] |= (m_block[i * 4 + 3]);
+            w[i] = static_cast<AZ::u32>(m_block[i * 4 + 0]) << 24;
+            w[i] |= static_cast<AZ::u32>(m_block[i * 4 + 1]) << 16;
+            w[i] |= static_cast<AZ::u32>(m_block[i * 4 + 2]) << 8;
+            w[i] |= static_cast<AZ::u32>(m_block[i * 4 + 3]);
         }
         for (size_t i = 16; i < 80; ++i)
         {
@@ -111,8 +111,8 @@ namespace AZ
 
         for (size_t i = 0; i < 80; ++i)
         {
-            AZ::u32 f;
-            AZ::u32 k;
+            AZ::u32 f{};
+            AZ::u32 k{};
 
             if (i < 20)
             {
@@ -150,12 +150,12 @@ namespace AZ
         m_h[4] += e;
     }
 
-    inline void Sha1::GetDigest(DigestType digest)
+    inline constexpr void Sha1::GetDigest(DigestType digest)
     {
-        size_t bit_count = m_byteCount * 8;
+        size_t bitCount = m_byteCount * 8;
 
         // append the bit '1' to the message
-        ProcessByte(0x80);
+        ProcessByte(AZStd::byte{ 0x80 });
 
         // append k bits '0', where k is the minimum number >= 0
         // such that the resulting message length is congruent to 56 (mod 64)
@@ -165,33 +165,33 @@ namespace AZ
             // finish this block
             while (m_blockByteIndex != 0)
             {
-                ProcessByte(0);
+                ProcessByte(AZStd::byte{});
             }
 
             // one more block
             while (m_blockByteIndex < 56)
             {
-                ProcessByte(0);
+                ProcessByte(AZStd::byte{});
             }
         }
         else
         {
             while (m_blockByteIndex < 56)
             {
-                ProcessByte(0);
+                ProcessByte({});
             }
         }
 
         // append length of message (before pre-processing) 
         // as a 64-bit big-endian integer
-        ProcessByte(0);
-        ProcessByte(0);
-        ProcessByte(0);
-        ProcessByte(0);
-        ProcessByte(static_cast<unsigned char>((bit_count >> 24) & 0xFF));
-        ProcessByte(static_cast<unsigned char>((bit_count >> 16) & 0xFF));
-        ProcessByte(static_cast<unsigned char>((bit_count >> 8) & 0xFF));
-        ProcessByte(static_cast<unsigned char>((bit_count) & 0xFF));
+        ProcessByte({});
+        ProcessByte({});
+        ProcessByte({});
+        ProcessByte({});
+        ProcessByte(static_cast<AZStd::byte>((bitCount >> 24) & 0xFF));
+        ProcessByte(static_cast<AZStd::byte>((bitCount >> 16) & 0xFF));
+        ProcessByte(static_cast<AZStd::byte>((bitCount >> 8) & 0xFF));
+        ProcessByte(static_cast<AZStd::byte>((bitCount) & 0xFF));
 
         // get final digest
         digest[0] = m_h[0];

+ 32 - 388
Code/Framework/AzCore/AzCore/Math/Uuid.cpp

@@ -7,232 +7,18 @@
  */
 
 #include <AzCore/Math/Uuid.h>
+#include <AzCore/Math/Guid.h>
 #include <AzCore/Math/Sfmt.h>
-#include <AzCore/Math/Sha1.h>
 
 #include <AzCore/std/algorithm.h>
 
-#include <AzCore/PlatformIncl.h>
-
-#include <AzCore/Math/Guid.h>
-
 namespace AZ
 {
-    static const char* const s_uuid_digits = "0123456789ABCDEFabcdef";
-    static const unsigned char s_uuid_values[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15, static_cast<unsigned char>(-1) };
-
-    //=========================================================================
-    // GetValue
-    // [4/10/2012]
-    //=========================================================================
-    unsigned char GetValue(char c)
+    Uuid Uuid::Create()
     {
-        char const* const digits_begin = s_uuid_digits;
-        char const* const digits_end = digits_begin + 22;
-        const char* d = AZStd::find(digits_begin, digits_end, c);
-        return s_uuid_values[d - digits_begin];
-    }
-
-    //=========================================================================
-    // CreateString
-    //=========================================================================
-    Uuid Uuid::CreateString(const char* string, size_t stringLength)
-    {
-        return CreateStringSkipWarnings(string, stringLength, false);
-    }
-
-    Uuid Uuid::CreateStringSkipWarnings(const char* string, size_t stringLength, [[maybe_unused]] bool skipWarnings)
-    {
-        if (string == nullptr)
-        {
-            return Uuid::CreateNull();
-        }
-
-        const char* current = string;
-        size_t      len = stringLength;
-
-        if (len == 0)
-        {
-            len = strlen(string);
-        }
-
-        if (len < 32 || len > 38)
-        {
-            AZ_Warning("Math", skipWarnings, "Invalid UUID format %s (must be) {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} (or without dashes and braces)", string != nullptr ? string : "null");
-            return Uuid::CreateNull();
-        }
-
-        // check open brace
-        char c = *current++;
-        [[maybe_unused]] bool has_open_brace = false;
-        if (c == '{')
-        {
-            c = *current++;
-            has_open_brace = true;
-        }
-        bool has_dashes = false;
-        Uuid id;
-        for (int i = 0; i < 16; ++i)
-        {
-            if (i == 4)
-            {
-                has_dashes = (c == '-');
-                if (has_dashes)
-                {
-                    c = *current++;
-                }
-            }
-
-            if (has_dashes)
-            {
-                if (i == 6 || i == 8 || i == 10)
-                {
-                    if (c == '-')
-                    {
-                        c = *current++;
-                    }
-                    else
-                    {
-                        AZ_Warning("Math", skipWarnings, "Invalid UUID format %s (must be) {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} (or without dashes and braces)", string);
-                        return Uuid::CreateNull();
-                    }
-                }
-            }
-
-            id.data[i] = GetValue(c);
-
-            c = *current++;
-
-            id.data[i] <<= 4;
-            id.data[i] |= GetValue(c);
-
-            c = *current++;
-        }
-
-        // check close brace
-        AZ_Warning("Math", !has_open_brace || skipWarnings || c == '}', "Invalid UUID format %s (must be) {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} (or without dashes and braces)", string);
-
-        return id;
-    }
-
-    Uuid Uuid::CreateStringPermissive(const char* uuidString, size_t stringLength, bool skipWarnings)
-    {
-        const size_t MaxPermissiveStringSize = 60;
-        if (stringLength == 0)
-        {
-            stringLength = strlen(uuidString);
-        }
-
-        size_t newLength{ 0 };
-        char createString[MaxPermissiveStringSize];
-
-        // Loop until we get to the end of the string OR stop once we've accumulated a full UUID string worth of data
-        for (size_t curPos = 0; curPos < stringLength && newLength < ValidUuidStringLength; ++curPos)
-        {
-            char curChar = uuidString[curPos];
-            switch (curChar)
-            {
-                // Bail early on expected no op characters
-                case '{':
-                {
-                    break;
-                }
-                case '}':
-                {
-                    break;
-                }
-                case ' ':
-                {
-                    break;
-                }
-                case '-':
-                {
-                    break;
-                }
-                case 'X':
-                    [[fallthrough]];
-                case 'x':
-                {
-                    // If we get 0xdeadbeef ignore the 0x
-                    if (curPos && uuidString[curPos - 1] == '0')
-                    {
-                        --newLength;
-                    }
-                    break;
-                    // If for some reason it's xdeadbeef skip the X because this function is permissive.
-                }
-                default:
-                {
-                    if ((curChar >= '0' && curChar <= '9') || (curChar >= 'a' && curChar <= 'f') || (curChar >= 'A' && curChar <= 'F'))
-                    {
-                        createString[newLength++] = curChar;
-                    }
-                    else
-                    {
-                        // "Other" characters could also just be skipped here if we wanted to be even more permissive
-                        if (!skipWarnings)
-                        {
-                            AZ_Warning("Math", false, "Unknown UUID character %c found at position %zu", curChar, curPos);
-                        }
-                        return Uuid::CreateNull();
-                    }
-                }
-            }
-        }
-        return CreateStringSkipWarnings(createString, newLength, skipWarnings);
-    }
-    //=========================================================================
-    // ToString
-    // [4/11/2012]
-    //=========================================================================
-    int
-    Uuid::ToString(char* output, int outputSize, bool isBrackets, bool isDashes) const
-    {
-        int minSize = 32 + 1 /*1 is terminate*/;
-        if (isDashes)
-        {
-            minSize += 4;
-        }
-        if (isBrackets)
-        {
-            minSize += 2;
-        }
-
-        if (outputSize < minSize)
-        {
-            return -minSize;
-        }
-
-        if (isBrackets)
-        {
-            *output++ = '{';
-        }
-
-        for (int i = 0; i < 16; ++i)
-        {
-            if (isDashes && (i == 4 || i == 6 || i == 8 || i == 10))
-            {
-                *output++ = '-';
-            }
-
-            unsigned char val = data[i];
-            *output++ = s_uuid_digits[(val >> 4)];
-            *output++ = s_uuid_digits[(val & 15)];
-        }
-
-        if (isBrackets)
-        {
-            *output++ = '}';
-        }
-
-        *output = '\0';
-        return minSize;
+        return CreateRandom();
     }
 
-    //=========================================================================
-    // CreateRandom
-    // [4/10/2012]
-    //=========================================================================
     Uuid Uuid::CreateRandom()
     {
         Uuid id;
@@ -245,199 +31,57 @@ namespace AZ
         id32[3] = smft.Rand32();
 
         // variant VAR_RFC_4122
-        id.data[8] &= 0xBF;
-        id.data[8] |= 0x80;
+        id.m_data[8] &= AZStd::byte(0xBF);
+        id.m_data[8] |= AZStd::byte(0x80);
 
         // version VER_RANDOM
-        id.data[6] &= 0x4F;
-        id.data[6] |= 0x40;
+        id.m_data[6] &= AZStd::byte(0x4F);
+        id.m_data[6] |= AZStd::byte(0x40);
 
         return id;
     }
 
-    //=========================================================================
-    // CreateName
-    // [4/10/2012]
-    //=========================================================================
-    Uuid Uuid::CreateName(const char* name)
-    {
-        return CreateData(name, strlen(name));
-    }
-
-    //=========================================================================
-    // CreateName
-    //=========================================================================
-    Uuid Uuid::CreateData(const void* data, size_t dataSize)
-    {
-        if (data && dataSize > 0)
-        {
-            Sha1 sha;
-            sha.ProcessBytes(data, dataSize);
-
-            AZ::u32 digest[5];
-            sha.GetDigest(digest);
-
-            Uuid id;
-            for (int i = 0; i < 4; ++i)
-            {
-                id.data[i * 4 + 0] = ((digest[i] >> 24) & 0xff);
-                id.data[i * 4 + 1] = ((digest[i] >> 16) & 0xff);
-                id.data[i * 4 + 2] = ((digest[i] >> 8) & 0xff);
-                id.data[i * 4 + 3] = ((digest[i] >> 0) & 0xff);
-            }
-
-            // variant VAR_RFC_4122
-            id.data[8] &= 0xBF;
-            id.data[8] |= 0x80;
-
-            // version VER_NAME_SHA1
-            id.data[6] &= 0x5F;
-            id.data[6] |= 0x50;
-
-            return id;
-        }
-        return Uuid::CreateNull();
-    }
-
-    //=========================================================================
-    // IsNull
-    // [4/10/2012]
-    //=========================================================================
-    bool Uuid::IsNull() const
-    {
-        const AZ::u64* value64 = reinterpret_cast<const AZ::u64*>(data);
-        if (value64[0] != 0 || value64[1] != 0)
-        {
-            return false;
-        }
-        return true;
-    }
-
-    //=========================================================================
-    // GetVariant
-    // [4/11/2012]
-    //=========================================================================
-    Uuid::Variant
-    Uuid::GetVariant() const
-    {
-        unsigned char val = data[8];
-        if ((val & 0x80) == 0x00)
-        {
-            return VAR_NCS;
-        }
-        else if ((val & 0xC0) == 0x80)
-        {
-            return VAR_RFC_4122;
-        }
-        else if ((val & 0xE0) == 0xC0)
-        {
-            return VAR_MICROSOFT;
-        }
-        else if ((val & 0xE0) == 0xE0)
-        {
-            return VAR_RESERVED;
-        }
-        else
-        {
-            return VAR_UNKNOWN;
-        }
-    }
-
-    //=========================================================================
-    // Version
-    // [4/11/2012]
-    //=========================================================================
-    Uuid::Version
-    Uuid::GetVersion() const
+#if AZ_TRAIT_UUID_SUPPORTS_GUID_CONVERSION
+    Uuid::Uuid(const GUID& guid)
     {
-        unsigned char val = data[6];
-        if ((val & 0xF0) == 0x10)
-        {
-            return VER_TIME;
-        }
-        else if ((val & 0xF0) == 0x20)
-        {
-            return VER_DCE;
-        }
-        else if ((val & 0xF0) == 0x30)
-        {
-            return VER_NAME_MD5;
-        }
-        else if ((val & 0xF0) == 0x40)
-        {
-            return VER_RANDOM;
-        }
-        else if ((val & 0xF0) == 0x50)
-        {
-            return VER_NAME_SHA1;
-        }
-        else
-        {
-            return VER_UNKNOWN;
-        }
+        memcpy(m_data, &guid, 16);
+        // make big endian (internal storage type), all supported platforms are little endian
+        AZStd::endian_swap(*reinterpret_cast<AZ::u32*>(&m_data[0]));
+        AZStd::endian_swap(*reinterpret_cast<AZ::u16*>(&m_data[4]));
+        AZStd::endian_swap(*reinterpret_cast<AZ::u16*>(&m_data[6]));
     }
 
-    //=========================================================================
-    // operator<
-    // [4/11/2012]
-    //=========================================================================
-    bool Uuid::operator<(const Uuid& rhs) const
+    Uuid::operator GUID() const
     {
-        return AZStd::lexicographical_compare(data, data + AZ_ARRAY_SIZE(data), rhs.data, rhs.data + AZ_ARRAY_SIZE(rhs.data));
+        GUID guid;
+        memcpy(&guid, m_data, 16);
+        // make big endian (internal storage type), all supported platforms are little endian
+        AZStd::endian_swap(guid.Data1);
+        AZStd::endian_swap(guid.Data2);
+        AZStd::endian_swap(guid.Data3);
+        return guid;
     }
 
-    //=========================================================================
-    // operator>
-    // [4/11/2012]
-    //=========================================================================
-    bool Uuid::operator>(const Uuid& rhs) const
+    Uuid& Uuid::operator=(const GUID& guid)
     {
-        return AZStd::lexicographical_compare(rhs.data, rhs.data + AZ_ARRAY_SIZE(rhs.data), data, data + AZ_ARRAY_SIZE(data));
+        return operator=(Uuid(guid));
     }
-
-    //=========================================================================
-    // operator+
-    //=========================================================================
-    Uuid Uuid::operator + (const Uuid& rhs) const
+    bool Uuid::operator==(const GUID& guid) const
     {
-        u8 mergedData[sizeof(data) * 2];
-        memcpy(mergedData, data, sizeof(data));
-        memcpy(mergedData + sizeof(data), rhs.data, sizeof(data));
-        return CreateData(&mergedData, AZ_ARRAY_SIZE(mergedData));
+        return operator==(Uuid(guid));
     }
-
-    Uuid::FixedString Uuid::ToFixedString(bool isBrackets, bool isDashes) const
+    bool Uuid::operator!=(const GUID& guid) const
     {
-        return ToString<FixedString>(isBrackets, isDashes);
+        return operator!=(Uuid(guid));
     }
 
-#if AZ_TRAIT_UUID_SUPPORTS_GUID_CONVERSION
-    //=========================================================================
-    // Uuid
-    // [4/10/2012]
-    //=========================================================================
-    Uuid::Uuid(const GUID& guid)
+    bool operator==(const GUID& guid, const Uuid& uuid)
     {
-        memcpy(data, &guid, 16);
-        // make big endian (internal storage type), windows is little endian
-        AZStd::endian_swap(*reinterpret_cast<unsigned int*>(&data[0]));
-        AZStd::endian_swap(*reinterpret_cast<unsigned short*>(&data[4]));
-        AZStd::endian_swap(*reinterpret_cast<unsigned short*>(&data[6]));
+        return Uuid(guid) == uuid;
     }
-
-    //=========================================================================
-    // GUID
-    // [4/10/2012]
-    //=========================================================================
-    Uuid::operator GUID() const
+    bool operator!=(const GUID& guid, const Uuid& uuid)
     {
-        GUID guid;
-        memcpy(&guid, data, 16);
-        // make big endian (internal storage type), windows is little endian
-        AZStd::endian_swap(guid.Data1);
-        AZStd::endian_swap(guid.Data2);
-        AZStd::endian_swap(guid.Data3);
-        return guid;
+        return Uuid(guid) != uuid;
     }
 
 #endif

+ 93 - 92
Code/Framework/AzCore/AzCore/Math/Uuid.h

@@ -8,9 +8,9 @@
 
 #pragma once
 
-#include <AzCore/Math/MathUtils.h>
 #include <AzCore/base.h>
 #include <AzCore/std/hash.h>
+#include <AzCore/std/ranges/ranges.h>
 #include <AzCore/std/string/fixed_string.h>
 
 #if AZ_TRAIT_UUID_SUPPORTS_GUID_CONVERSION
@@ -18,26 +18,27 @@ struct  _GUID;
 typedef _GUID GUID;
 #endif
 
+
 namespace AZ
 {
     struct Uuid
     {
         enum Variant
         {
-            VAR_UNKNOWN         = -1,
-            VAR_NCS             = 0, // 0 - -
-            VAR_RFC_4122        = 2, // 1 0 -
-            VAR_MICROSOFT       = 6, // 1 1 0
-            VAR_RESERVED        = 7  // 1 1 1
+            VAR_UNKNOWN = -1,
+            VAR_NCS = 0, // 0 - -
+            VAR_RFC_4122 = 2, // 1 0 -
+            VAR_MICROSOFT = 6, // 1 1 0
+            VAR_RESERVED = 7  // 1 1 1
         };
         enum Version
         {
-            VER_UNKNOWN         = -1,
-            VER_TIME            = 1, // 0 0 0 1
-            VER_DCE             = 2, // 0 0 1 0
-            VER_NAME_MD5        = 3, // 0 0 1 1
-            VER_RANDOM          = 4, // 0 1 0 0
-            VER_NAME_SHA1       = 5, // 0 1 0 1
+            VER_UNKNOWN = -1,
+            VER_TIME = 1, // 0 0 0 1
+            VER_DCE = 2, // 0 0 1 0
+            VER_NAME_MD5 = 3, // 0 0 1 1
+            VER_RANDOM = 4, // 0 1 0 0
+            VER_NAME_SHA1 = 5, // 0 1 0 1
             // AZ Custom version, same as VER_RANDOM except we store a CRC32 in the first 4 bytes
             // you can add and combine in this 32 bytes.
             //VER_AZ_RANDOM_CRC32 = 6, // 0 1 1 0
@@ -47,11 +48,12 @@ namespace AZ
         static constexpr size_t MaxStringBuffer = 39; /// 32 Uuid + 4 dashes + 2 brackets + 1 terminate
         using FixedString = AZStd::fixed_string<MaxStringBuffer>;
         constexpr Uuid() = default;
-        Uuid(const char* string, size_t stringLength = 0) { *this = CreateString(string, stringLength); }
+        constexpr explicit Uuid(AZStd::string_view uuidString);
+        constexpr Uuid(const char* string, size_t stringLength);
 
-        static constexpr Uuid CreateNull() { return Uuid{}; };
+        static constexpr Uuid CreateNull();
         /// Create a Uuid (VAR_RFC_4122,VER_RANDOM)
-        static Uuid Create()        { return CreateRandom(); }
+        static Uuid Create();
         /**
         * This function accepts the following formats, if format is invalid it returns a NULL UUID.
         * 0123456789abcdef0123456789abcdef
@@ -59,23 +61,29 @@ namespace AZ
         * {01234567-89ab-cdef-0123-456789abcdef}
         * {0123456789abcdef0123456789abcdef}
         * \param string pointer to a string buffer
-        * \param stringLength if zero 'string' pointer must be null terminated so we can compute it's length, otherwise you can provide the length of the buffer.
+        * \param stringLength length of the string in the buffer
         */
-        static Uuid CreateString(const char* string, size_t stringLength = 0);
-        static Uuid CreateStringSkipWarnings(const char* string, size_t stringLength, bool skipWarnings);
+        static constexpr Uuid CreateString(const char* string, size_t stringLength);
+        static constexpr Uuid CreateString(AZStd::string_view uuidString);
 
         // Performs a first pass to handle more uuid string formats - allows and removes spaces, 0x, {, }
-        static Uuid CreateStringPermissive(const char* string, size_t stringLength = 0, bool skipWarnings = true);
+        static constexpr Uuid CreateStringPermissive(const char* string, size_t stringLength, bool skipWarnings = true);
+        static constexpr Uuid CreateStringPermissive(AZStd::string_view uuidString, bool skipWarnings = true);
 
         static Uuid CreateRandom();
         /// Create a UUID based on a string name (sha1)
-        static Uuid CreateName(const char* name);
+        static constexpr Uuid CreateName(AZStd::string_view name);
         /// Create a UUID based on a byte stream (sha1)
-        static Uuid CreateData(const void* data, size_t dataSize);
-
-        bool    IsNull() const;
-        Variant GetVariant() const;
-        Version GetVersion() const;
+        static constexpr Uuid CreateData(const AZStd::byte* data, size_t dataSize);
+        // Accepts a range whose value type is implicitly or explicitly convertible to an AZStd::byte
+        template<class R>
+        static constexpr auto CreateData(R&& dataSpan)
+            -> AZStd::enable_if_t<AZStd::convertible_to<AZStd::ranges::range_value_t<R>, AZStd::byte>
+            || decltype(static_cast<AZStd::byte>(AZStd::declval<AZStd::ranges::range_value_t<R>>()), AZStd::true_type())::value, Uuid>;
+
+        constexpr bool IsNull() const;
+        constexpr Variant GetVariant() const;
+        constexpr Version GetVersion() const;
         /**
          * Outputs to a string in one of the following formats
          * 0123456789abcdef0123456789abcdef
@@ -86,7 +94,7 @@ namespace AZ
          * if negative the the number of characters required for output (nothing is writen to the output),
          * including terminating character.
          */
-        int ToString(char* output, int outputSize, bool isBrackets = true, bool isDashes = true) const;
+        constexpr int ToString(char* output, int outputSize, bool isBrackets = true, bool isDashes = true) const;
 
         /**
          * Outputs to a string in one of the following formats
@@ -99,103 +107,96 @@ namespace AZ
          * including terminating character.
          */
         template<size_t SizeT>
-        int ToString(char(&output)[SizeT], bool isBrackets = true, bool isDashes = true) const
-        {
-            return ToString(output, SizeT, isBrackets, isDashes);
-        }
+        constexpr int ToString(char(&output)[SizeT], bool isBrackets = true, bool isDashes = true) const;
 
         /// The only requirements is that StringType can be constructed from char* and it can copied.
         template<class StringType>
-        inline StringType ToString(bool isBrackets = true, bool isDashes = true) const
-        {
-            char output[MaxStringBuffer];
-            ToString(output, AZ_ARRAY_SIZE(output), isBrackets, isDashes);
-            return StringType(output);
-        }
+        constexpr StringType ToString(bool isBrackets = true, bool isDashes = true) const;
 
         /// For inplace version we require resize, data and size members.
         template<class StringType>
-        inline void ToString(StringType& result, bool isBrackets = true, bool isDashes = true) const
-        {
-            result.resize(-ToString(nullptr, 0, isBrackets, isDashes) - 1); // remove the terminating string
-            ToString(&result[0], static_cast<int>(result.size()) + 1, isBrackets, isDashes);
-        }
+        constexpr void ToString(StringType& result, bool isBrackets = true, bool isDashes = true) const;
 
-        FixedString ToFixedString(bool isBrackets = true, bool isDashes = true) const;
+        constexpr FixedString ToFixedString(bool isBrackets = true, bool isDashes = true) const;
 
-        AZ_MATH_INLINE bool operator==(const Uuid& rhs) const
-        {
-            const AZ::u64* lhs64 = reinterpret_cast<const AZ::u64*>(data);
-            const AZ::u64* rhs64 = reinterpret_cast<const AZ::u64*>(rhs.data);
-            if (lhs64[0] != rhs64[0] || lhs64[1] != rhs64[1])
-            {
-                return false;
-            }
-            return true;
-        }
-        AZ_MATH_INLINE bool operator!=(const Uuid& rhs) const { return !(*this == rhs); }
-        bool operator<(const Uuid& rhs) const;
-        bool operator>(const Uuid& rhs) const;
-        bool operator<=(const Uuid& rhs) const { return !(*this > rhs); }
-        bool operator>=(const Uuid& rhs) const { return !(*this < rhs); }
+        constexpr bool operator==(const Uuid& rhs) const;
+        constexpr bool operator!=(const Uuid& rhs) const;
+        constexpr bool operator<(const Uuid& rhs) const;
+        constexpr bool operator>(const Uuid& rhs) const;
+        constexpr bool operator<=(const Uuid& rhs) const;
+        constexpr bool operator>=(const Uuid& rhs) const;
 
-    #if AZ_TRAIT_UUID_SUPPORTS_GUID_CONVERSION
+#if AZ_TRAIT_UUID_SUPPORTS_GUID_CONVERSION
         // Add some conversion to from windows
         Uuid(const GUID& guid);
         operator GUID() const;
-        AZ_MATH_INLINE Uuid& operator=(const GUID& guid)          { *this = Uuid(guid); return *this; }
-        AZ_MATH_INLINE bool operator==(const GUID& guid) const    { return *this == Uuid(guid); }
-        AZ_MATH_INLINE bool operator!=(const GUID& guid) const    { return !(*this == guid);  }
-    #endif
+        Uuid& operator=(const GUID& guid);
+        bool operator==(const GUID& guid) const;
+        bool operator!=(const GUID& guid) const;
+        friend bool operator==(const GUID& guid, const Uuid& uuid);
+        friend bool operator!=(const GUID& guid, const Uuid& uuid);
+#endif
 
         /// Adding two UUID generates SHA1 Uuid based on the data of both uuids
-        Uuid operator+(const Uuid& rhs) const;
-        AZ_MATH_INLINE Uuid& operator+=(const Uuid& rhs)      { *this = *this + rhs; return *this; }
+        friend constexpr Uuid operator+(const Uuid& lhs, const Uuid& rhs);
+        constexpr Uuid& operator+=(const Uuid& rhs);
 
         //////////////////////////////////////////////////////////////////////////
         // AZStd interface
-        typedef unsigned char*          iterator;
-        typedef const unsigned char*    const_iterator;
-
-        AZ_MATH_INLINE iterator begin()               { return data; }
-        AZ_MATH_INLINE iterator end()                 { return data + AZ_ARRAY_SIZE(data); }
-        AZ_MATH_INLINE const_iterator begin() const   { return data; }
-        AZ_MATH_INLINE const_iterator end() const     { return data + AZ_ARRAY_SIZE(data); }
+        using iterator = AZStd::byte*;
+        using const_iterator = const AZStd::byte*;
+
+        constexpr iterator begin();
+        constexpr iterator end();
+        constexpr const_iterator begin() const;
+        constexpr const_iterator end() const;
+        constexpr size_t size() const;
         //////////////////////////////////////////////////////////////////////////
 
-        size_t GetHash() const
-        {
-            // Returning first few bytes as a size_t. This is faster than
-            // hashing every byte and the chance of collision is still very low.
-            union
-            {
-                const size_t* hash;
-                const unsigned char* data;
-            } convert;
-
-            convert.data = data;
-            return *convert.hash;
-        }
+        //! Returns the first 8 bytes of the Uuid interpreted as a little endian
+        //! size_t value as the hash value
+        constexpr size_t GetHash() const;
 
-        // or _m128i and VMX ???
-        alignas(16) unsigned char data[16]{};
+    private:
+        static constexpr Uuid CreateStringSkipWarnings(AZStd::string_view uuidString, bool skipWarnings);
+
+        //! Converts the next 8 bytes starting from startIndex into a size_t
+        //! The startIndex represents the low byte of a little endian integer
+        constexpr size_t GetSectionAsSizeT(size_t startIndex) const;
+        //! Retrieves the first 8 bytes of the UUID(m_data[7] ... m_data[0]) as a size_t
+        //! in little endian format
+        constexpr size_t GetFirst8BytesAsSizeT() const;
+        //! Retrieves the last 8 bytes of the UUID(m_data[15] ... m_data[8]) as a size_t
+        //! in little endian format
+        constexpr size_t GetLast8BytesAsSizeT() const;
+
+        alignas(16) AZStd::byte m_data[16]{};
     };
+
+//! O3DE_UUID_TO_NONTYPE_PARAM macro is for associating a Uuid with a non-type template parameter
+//! It does this by taking the Hash Value of the TypeId which is the top 8 bytes of the Uuid
+//! and converting using that as the template parameter.
+//! The entire 16 byte Uuid can't be used until C++20 compiler support is available as literal class types
+//! are not available for use as non-type parameters until then
+//! An example of the use is as below
+//! template<auto Uuid>
+//! static bool VersionConverter(...)
+//! template<>
+//! static bool VersionConverter<O3DE_UUID_TO_NONTYPE_PARAM(AZ::Uuid("01234567-89ab-cdef-0123-456789abcdef"))>(...)
+#define O3DE_UUID_TO_NONTYPE_PARAM(literal_) AZ::Uuid(literal_).GetHash()
 } // namespace AZ
 
 namespace AZStd
 {
-    template<class T>
-    struct hash;
-
     // hash specialization
     template <>
     struct hash<AZ::Uuid>
     {
-        typedef AZ::Uuid    argument_type;
-        typedef size_t      result_type;
-        AZ_FORCE_INLINE size_t operator()(const AZ::Uuid& id) const
+        constexpr size_t operator()(const AZ::Uuid& id) const
         {
             return id.GetHash();
         }
     };
 }
+
+#include <AzCore/Math/Uuid.inl>

+ 491 - 0
Code/Framework/AzCore/AzCore/Math/Uuid.inl

@@ -0,0 +1,491 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#include <AzCore/Math/Sha1.h>
+
+#include <AzCore/Casting/numeric_cast.h>
+#include <AzCore/std/containers/array.h>
+#include <AzCore/std/limits.h>
+#include <AzCore/std/ranges/ranges_algorithm.h>
+#include <AzCore/std/ranges/ranges_to.h>
+#include <AzCore/std/string/fixed_string.h>
+
+namespace AZ::UuidInternal
+{
+    constexpr AZStd::byte GetValue(char c)
+    {
+        constexpr AZStd::string_view UuidChars = "0123456789ABCDEFabcdef";
+        // CharToHexDigit is 1 more character than UuidChars array
+        constexpr auto CharToHexDigit = AZStd::to_array<AZStd::byte>({
+            AZStd::byte(0),AZStd::byte(1), AZStd::byte(2), AZStd::byte(3),
+            AZStd::byte(4), AZStd::byte(5), AZStd::byte(6), AZStd::byte(7),
+            AZStd::byte(8), AZStd::byte(9),
+            AZStd::byte(10), AZStd::byte(11), AZStd::byte(12), AZStd::byte(13), AZStd::byte(14), AZStd::byte(15),
+            AZStd::byte(10), AZStd::byte(11), AZStd::byte(12), AZStd::byte(13), AZStd::byte(14), AZStd::byte(15),
+            AZStd::numeric_limits<AZStd::byte>::max() });
+        const char* hexDigit = AZStd::ranges::find(UuidChars, c);
+        return CharToHexDigit[hexDigit - UuidChars.data()];
+    }
+}
+
+namespace AZ
+{
+    constexpr Uuid::Uuid(AZStd::string_view uuidString)
+    {
+        operator=(CreateString(uuidString));
+    }
+    constexpr Uuid::Uuid(const char* string, size_t stringLength)
+    {
+        operator=(CreateString(string, stringLength));
+    }
+
+    constexpr Uuid Uuid::CreateNull()
+    {
+        return Uuid{};
+    }
+
+    constexpr Uuid Uuid::CreateString(const char* string, size_t stringLength)
+    {
+        return CreateString({ string, stringLength });
+    }
+
+    constexpr Uuid Uuid::CreateString(AZStd::string_view uuidString)
+    {
+        return CreateStringSkipWarnings(uuidString, false);
+    }
+
+    constexpr Uuid Uuid::CreateStringSkipWarnings(AZStd::string_view uuidString, [[maybe_unused]] bool skipWarnings)
+    {
+        if (uuidString.empty())
+        {
+            return {};
+        }
+
+        [[maybe_unused]] constexpr const char* InvalidFormatFormat = "Invalid UUID format %.*s (must be)"
+            " {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} (or without dashes and braces)";
+
+        if (uuidString.size() < 32 || uuidString.size() > 38)
+        {
+            AZStd::string_view errorString = !uuidString.empty() ? uuidString : AZStd::string_view("null");
+            AZ_Warning("Math", skipWarnings, InvalidFormatFormat, AZ_STRING_ARG(errorString));
+            return {};
+        }
+
+        const char* current = uuidString.data();
+
+        // check open brace
+        char c = *current++;
+        [[maybe_unused]] bool hasOpenBrace = false;
+        if (c == '{')
+        {
+            c = *current++;
+            hasOpenBrace = true;
+        }
+        bool hasDashes = false;
+        Uuid id;
+        for (int i = 0; i < 16; ++i)
+        {
+            if (i == 4)
+            {
+                hasDashes = (c == '-');
+                if (hasDashes)
+                {
+                    c = *current++;
+                }
+            }
+
+            if (hasDashes)
+            {
+                if (i == 6 || i == 8 || i == 10)
+                {
+                    if (c == '-')
+                    {
+                        c = *current++;
+                    }
+                    else
+                    {
+                        AZ_Warning("Math", skipWarnings, InvalidFormatFormat, AZ_STRING_ARG(uuidString));
+                        return Uuid::CreateNull();
+                    }
+                }
+            }
+
+            id.m_data[i] = UuidInternal::GetValue(c);
+
+            c = *current++;
+
+            id.m_data[i] <<= 4;
+            id.m_data[i] |= UuidInternal::GetValue(c);
+
+            c = *current++;
+        }
+
+        // check close brace
+        AZ_Warning("Math", !hasOpenBrace || skipWarnings || c == '}', InvalidFormatFormat,
+            AZ_STRING_ARG(uuidString));
+
+        return id;
+    }
+
+
+    constexpr Uuid Uuid::CreateStringPermissive(const char* uuidString, size_t stringLength, bool skipWarnings)
+    {
+        return CreateStringPermissive({ uuidString, stringLength }, skipWarnings);
+    }
+
+    constexpr Uuid Uuid::CreateStringPermissive(AZStd::string_view uuidString, bool skipWarnings)
+    {
+        constexpr size_t MaxPermissiveStringSize = 60;
+
+        size_t newLength{ 0 };
+        char createString[MaxPermissiveStringSize]{'\0'};
+
+        // Loop until we get to the end of the string OR stop once we've accumulated a full UUID string worth of data
+        for (size_t curPos = 0; curPos < uuidString.size() && newLength < ValidUuidStringLength; ++curPos)
+        {
+            char curChar = uuidString[curPos];
+            switch (curChar)
+            {
+                // Bail early on expected no op characters
+                case '{':
+                {
+                    break;
+                }
+                case '}':
+                {
+                    break;
+                }
+                case ' ':
+                {
+                    break;
+                }
+                case '-':
+                {
+                    break;
+                }
+                case 'X':
+                    [[fallthrough]];
+                case 'x':
+                {
+                    // If we get 0xdeadbeef ignore the 0x
+                    if (curPos && uuidString[curPos - 1] == '0')
+                    {
+                        --newLength;
+                    }
+                    break;
+                    // If for some reason it's xdeadbeef skip the X because this function is permissive.
+                }
+                default:
+                {
+                    if ((curChar >= '0' && curChar <= '9') || (curChar >= 'a' && curChar <= 'f') || (curChar >= 'A' && curChar <= 'F'))
+                    {
+                        createString[newLength++] = curChar;
+                    }
+                    else
+                    {
+                        // "Other" characters could also just be skipped here if we wanted to be even more permissive
+                        if (!skipWarnings)
+                        {
+                            AZ_Warning("Math", false, "Unknown UUID character %c found at position %zu", curChar, curPos);
+                        }
+                        return {};
+                    }
+                }
+            }
+        }
+        return CreateStringSkipWarnings({ createString, newLength }, skipWarnings);
+    }
+
+    // ToString conversion functions
+    constexpr int Uuid::ToString(char* output, int outputSize, bool isBrackets, bool isDashes) const
+    {
+        int minSize = 32 + 1 /*1 is terminate*/;
+        if (isDashes)
+        {
+            minSize += 4;
+        }
+        if (isBrackets)
+        {
+            minSize += 2;
+        }
+
+        if (outputSize < minSize)
+        {
+            return -minSize;
+        }
+
+        if (isBrackets)
+        {
+            *output++ = '{';
+        }
+
+        constexpr AZStd::string_view UuidChars = "0123456789ABCDEFabcdef";
+        for (int i = 0; i < 16; ++i)
+        {
+            if (isDashes && (i == 4 || i == 6 || i == 8 || i == 10))
+            {
+                *output++ = '-';
+            }
+
+            AZStd::byte val = m_data[i];
+            *output++ = UuidChars[static_cast<size_t>(val >> 4)];
+            *output++ = UuidChars[static_cast<size_t>(val & AZStd::byte(0xF))];
+        }
+
+        if (isBrackets)
+        {
+            *output++ = '}';
+        }
+
+        *output = '\0';
+        return minSize;
+    }
+
+    template<size_t SizeT>
+    constexpr int Uuid::ToString(char(&output)[SizeT], bool isBrackets, bool isDashes) const
+    {
+        return ToString(output, SizeT, isBrackets, isDashes);
+    }
+
+    /// The only requirements is that StringType can be constructed from char* and it can copied.
+    template<class StringType>
+    constexpr StringType Uuid::ToString(bool isBrackets, bool isDashes) const
+    {
+        return AZStd::ranges::to<StringType>(ToFixedString(isBrackets, isDashes));
+    }
+
+    /// For inplace version we require resize, data and size members.
+    template<class StringType>
+    constexpr void Uuid::ToString(StringType& result, bool isBrackets, bool isDashes) const
+    {
+        FixedString uuidString = ToFixedString(isBrackets, isDashes);
+        // Copy the uuid in a fixed_string instance over to the result
+        result.assign_range(uuidString);
+    }
+
+    constexpr auto Uuid::ToFixedString(bool isBrackets, bool isDashes) const -> FixedString
+    {
+        auto WriteStringToCharBuffer = [this, isBrackets, isDashes](char* buffer, size_t bufferSize)
+        {
+            int sizePlusNullTerminator = ToString(buffer, static_cast<int>(bufferSize), isBrackets, isDashes);
+            // Must substract out the size of the null-terminating string
+            return sizePlusNullTerminator - 1;
+        };
+        FixedString resultString;
+        resultString.resize_and_overwrite(MaxStringBuffer, WriteStringToCharBuffer);
+
+        return resultString;
+    }
+
+    template<class R>
+    constexpr auto Uuid::CreateData(R&& dataSpan)
+        -> AZStd::enable_if_t<AZStd::convertible_to<AZStd::ranges::range_value_t<R>, AZStd::byte>
+        || decltype(static_cast<AZStd::byte>(AZStd::declval<AZStd::ranges::range_value_t<R>>()), AZStd::true_type())::value, Uuid>
+    {
+        if (!dataSpan.empty())
+        {
+            Sha1 sha;
+            for (auto element : dataSpan)
+            {
+                sha.ProcessByte(static_cast<AZStd::byte>(element));
+            }
+
+            AZ::u32 digest[5]{};
+            sha.GetDigest(digest);
+
+            Uuid id;
+            for (int i = 0; i < 4; ++i)
+            {
+                id.m_data[i * 4 + 0] = AZStd::byte((digest[i] >> 24) & 0xff);
+                id.m_data[i * 4 + 1] = AZStd::byte((digest[i] >> 16) & 0xff);
+                id.m_data[i * 4 + 2] = AZStd::byte((digest[i] >> 8) & 0xff);
+                id.m_data[i * 4 + 3] = AZStd::byte((digest[i] >> 0) & 0xff);
+            }
+
+            // variant VAR_RFC_4122
+            id.m_data[8] &= AZStd::byte(0xBF);
+            id.m_data[8] |= AZStd::byte(0x80);
+
+            // version VER_NAME_SHA1
+            id.m_data[6] &= AZStd::byte(0x5F);
+            id.m_data[6] |= AZStd::byte(0x50);
+
+            return id;
+        }
+        return Uuid{};
+    }
+
+    constexpr Uuid Uuid::CreateName(AZStd::string_view name)
+    {
+        return CreateData(name);
+    }
+
+    constexpr Uuid Uuid::CreateData(const AZStd::byte* data, size_t dataSize)
+    {
+        return CreateData(AZStd::span(data, dataSize));
+    }
+
+    constexpr bool Uuid::IsNull() const
+    {
+        constexpr AZStd::byte zeroBytes[16]{};
+        return AZStd::ranges::equal(m_data, zeroBytes);
+    }
+
+    constexpr bool Uuid::operator==(const Uuid& rhs) const
+    {
+        return AZStd::ranges::equal(m_data, rhs.m_data);
+    }
+    constexpr bool Uuid::operator!=(const Uuid& rhs) const
+    {
+        return !operator==(rhs);
+    }
+
+    constexpr bool Uuid::operator<(const Uuid& rhs) const
+    {
+        return AZStd::ranges::lexicographical_compare(m_data, rhs.m_data);
+    }
+    constexpr bool Uuid::operator>(const Uuid& rhs) const
+    {
+        return rhs.operator<(*this);
+    }
+    constexpr bool Uuid::operator<=(const Uuid& rhs) const
+    {
+        return !rhs.operator<(*this);
+    }
+    constexpr bool Uuid::operator>=(const Uuid& rhs) const
+    {
+        return !operator<(rhs);
+    }
+
+    constexpr auto Uuid::GetVariant() const -> Variant
+    {
+        AZStd::byte val = m_data[8];
+        if ((val & AZStd::byte{ 0x80 }) == AZStd::byte{ 0x00 })
+        {
+            return VAR_NCS;
+        }
+        else if ((val & AZStd::byte{ 0xC0 }) == AZStd::byte{ 0x80 })
+        {
+            return VAR_RFC_4122;
+        }
+        else if ((val & AZStd::byte{ 0xE0 }) == AZStd::byte{ 0xC0 })
+        {
+            return VAR_MICROSOFT;
+        }
+        else if ((val & AZStd::byte{ 0xE0 }) == AZStd::byte{ 0xE0 })
+        {
+            return VAR_RESERVED;
+        }
+        else
+        {
+            return VAR_UNKNOWN;
+        }
+    }
+
+    constexpr auto Uuid::GetVersion() const -> Version
+    {
+        AZStd::byte val = m_data[6];
+        if ((val & AZStd::byte{ 0xF0 }) == AZStd::byte{ 0x10 })
+        {
+            return VER_TIME;
+        }
+        else if ((val & AZStd::byte{ 0xF0 }) == AZStd::byte{ 0x20 })
+        {
+            return VER_DCE;
+        }
+        else if ((val & AZStd::byte{ 0xF0 }) == AZStd::byte{ 0x30 })
+        {
+            return VER_NAME_MD5;
+        }
+        else if ((val & AZStd::byte{ 0xF0 }) == AZStd::byte{ 0x40 })
+        {
+            return VER_RANDOM;
+        }
+        else if ((val & AZStd::byte{ 0xF0 }) == AZStd::byte{ 0x50 })
+        {
+            return VER_NAME_SHA1;
+        }
+        else
+        {
+            return VER_UNKNOWN;
+        }
+    }
+
+    constexpr Uuid operator+(const Uuid& lhs, const Uuid& rhs)
+    {
+        // Combines both Uuids into 1 single buffer
+        AZStd::array<AZStd::byte, sizeof(Uuid::m_data) * 2> mergedData{AZStd::byte{}};
+        AZStd::ranges::copy(lhs, mergedData.begin());
+        AZStd::ranges::copy(rhs, mergedData.begin() + sizeof(Uuid::m_data));
+        return Uuid::CreateData(mergedData);
+    }
+
+    constexpr Uuid& Uuid::operator+=(const Uuid& rhs)
+    {
+        *this = *this + rhs;
+        return *this;
+    }
+
+    // Ranges inter-op functions
+    constexpr auto Uuid::begin() -> iterator
+    {
+        return m_data;
+    }
+    constexpr auto Uuid::begin() const -> const_iterator
+    {
+        return m_data;
+    }
+    constexpr auto Uuid::end() -> iterator
+    {
+        return m_data + AZ_ARRAY_SIZE(m_data);
+    }
+    constexpr auto Uuid::end() const -> const_iterator
+    {
+        return m_data + AZ_ARRAY_SIZE(m_data);
+    }
+    constexpr size_t Uuid::size() const
+    {
+        return AZ_ARRAY_SIZE(m_data);
+    }
+
+    // Hash function
+    constexpr size_t Uuid::GetHash() const
+    {
+        return GetFirst8BytesAsSizeT();
+    }
+
+    // Uuid to size_t chunk functions
+
+    //! Converts the next 8 bytes from the startIndex into a size_t in little endian format
+    //! i.e the startIndex position is the low byte and startIndex + 7 is the high byte
+    constexpr size_t Uuid::GetSectionAsSizeT(size_t startIndex) const
+    {
+        return static_cast<size_t>(m_data[startIndex + 7]) << (AZStd::numeric_limits<size_t>::digits - 8)
+            | static_cast<size_t>(m_data[startIndex + 6]) << (AZStd::numeric_limits<size_t>::digits - 16)
+            | static_cast<size_t>(m_data[startIndex + 5]) << (AZStd::numeric_limits<size_t>::digits - 24)
+            | static_cast<size_t>(m_data[startIndex + 4]) << (AZStd::numeric_limits<size_t>::digits - 32)
+            | static_cast<size_t>(m_data[startIndex + 3]) << (AZStd::numeric_limits<size_t>::digits - 40)
+            | static_cast<size_t>(m_data[startIndex + 2]) << (AZStd::numeric_limits<size_t>::digits - 48)
+            | static_cast<size_t>(m_data[startIndex + 1]) << (AZStd::numeric_limits<size_t>::digits - 56)
+            | static_cast<size_t>(m_data[startIndex + 0]);
+    }
+
+    //! Retrieves the first 8 bytes of the UUID(m_data[7] ... m_data[0]) as a size_t
+    //! in little endian format
+    constexpr size_t Uuid::GetFirst8BytesAsSizeT() const
+    {
+        return GetSectionAsSizeT(0);
+    }
+
+    //! Retrieves the last 8 bytes of the UUID(m_data[15] ... m_data[8]) as a size_t
+    //! in little endian format
+    constexpr size_t Uuid::GetLast8BytesAsSizeT() const
+    {
+        return GetSectionAsSizeT(8);
+    }
+} // namespace AZ

+ 2 - 75
Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp

@@ -54,79 +54,6 @@ namespace AZ
 // Enabled mutex per bucket
 #define USE_MUTEX_PER_BUCKET
 
-    namespace HphaInternal
-    {
-        //! Rounds up a value to next power of 2.
-        //! For example to round 8388609((2^23) + 1) up to 16777216(2^24) the following occurs
-        //! Subtract one from the value in case it is already
-        //! equal to a power of 2
-        //! 8388609 - 1 = 8388608
-        //! Propagate the highest one bit in the value to all the lower bits
-        //! 8388608 = 0b100'0000'0000'0000'0000'0000 in binary
-        //!
-        //!  0b100'0000'0000'0000'0000'0000
-        //! |0b010'0000'0000'0000'0000'0000 (>> 1)
-        //! -------------------------------
-        //!  0b110'0000'0000'0000'0000'0000 (Now there are 2 consecutive 1-bits)
-        //! |0b001'1000'0000'0000'0000'0000 (>> 2)
-        //! -------------------------------
-        //!  0b111'1000'0000'0000'0000'0000 (Now there are 4 consecutive 1-bits)
-        //! |0b000'0111'1000'0000'0000'0000 (>> 4)
-        //! -------------------------------
-        //!  0b111'1111'1000'0000'0000'0000 (Now there are 8 consecutive 1-bits)
-        //! |0b000'0000'0111'1111'1000'0000 (>> 8)
-        //! -------------------------------
-        //!  0b111'1111'1111'1111'1000'0000 (Now there are 16 consecutive 1-bits)
-        //! |0b000'0000'0000'0000'0111'1111 (>> 16)
-        //! -------------------------------
-        //!  0b111'1111'1111'1111'1111'1111 (Now there are 23 consecutive 1-bits)
-        //! |0b000'0000'0000'0000'0000'0000 (>> 32)
-        //! -------------------------------
-        //!  0b111'1111'1111'1111'1111'1111
-        //! Finally since all the one bits are set in the value, adding one pushes it
-        //! to next power of 2
-        //! 0b1000'0000'0000'0000'0000'0000 = 16777216
-        static constexpr size_t AlignUpToPowerOfTwo(size_t value)
-        {
-            // If the value is <=2 it is already aligned
-            if (value <= 2)
-            {
-                return value;
-            }
-
-            // Subtract one to make any values already
-            // aligned to a power of 2 less than that power of 2
-            // so that algorithm doesn't push those values upwards
-            --value;
-            value |= value >> 0b1;
-            value |= value >> 0b10;
-            value |= value >> 0b100;
-            value |= value >> 0b1000;
-            value |= value >> 0b1'0000;
-            value |= value >> 0b10'0000;
-            ++value;
-            return value;
-        }
-
-        static_assert(AlignUpToPowerOfTwo(0) == 0);
-        static_assert(AlignUpToPowerOfTwo(1) == 1);
-        static_assert(AlignUpToPowerOfTwo(2) == 2);
-        static_assert(AlignUpToPowerOfTwo(3) == 4);
-        static_assert(AlignUpToPowerOfTwo(4) == 4);
-        static_assert(AlignUpToPowerOfTwo(5) == 8);
-        static_assert(AlignUpToPowerOfTwo(8) == 8);
-        static_assert(AlignUpToPowerOfTwo(10) == 16);
-        static_assert(AlignUpToPowerOfTwo(16) == 16);
-        static_assert(AlignUpToPowerOfTwo(24) == 32);
-        static_assert(AlignUpToPowerOfTwo(32) == 32);
-        static_assert(AlignUpToPowerOfTwo(45) == 64);
-        static_assert(AlignUpToPowerOfTwo(64) == 64);
-        static_assert(AlignUpToPowerOfTwo(112) == 128);
-        static_assert(AlignUpToPowerOfTwo(128) == 128);
-        static_assert(AlignUpToPowerOfTwo(136) == 256);
-        static_assert(AlignUpToPowerOfTwo(256) == 256);
-    }
-
     //////////////////////////////////////////////////////////////////////////
 
     template<bool DebugAllocatorEnable>
@@ -281,9 +208,9 @@ namespace AZ
         using page_list = AZStd::intrusive_list<page, AZStd::list_base_hook<page>>;
 
 #if defined(MULTITHREADED) && defined(USE_MUTEX_PER_BUCKET)
-        static constexpr size_t BucketAlignment = HphaInternal::AlignUpToPowerOfTwo(sizeof(page_list) + sizeof(AZStd::mutex) + sizeof(size_t));
+        static constexpr size_t BucketAlignment = AlignUpToPowerOfTwo(sizeof(page_list) + sizeof(AZStd::mutex) + sizeof(size_t));
 #else
-        static constexpr size_t BucketAlignment = HphaInternal::AlignUpToPowerOfTwo(sizeof(page_list) + sizeof(size_t));
+        static constexpr size_t BucketAlignment = AlignUpToPowerOfTwo(sizeof(page_list) + sizeof(size_t));
 #endif
         AZ_PUSH_DISABLE_WARNING_MSVC(4324)
         class alignas(BucketAlignment) bucket

+ 2 - 2
Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.cpp

@@ -270,7 +270,7 @@ namespace AZ
     //=========================================================================
     // GetTypeId
     //=========================================================================
-    const AZ::Uuid& BehaviorProperty::GetTypeId() const
+    AZ::TypeId BehaviorProperty::GetTypeId() const
     {
         if (m_getter)
         {
@@ -960,7 +960,7 @@ namespace AZ
             return ((static_cast<AZ::u64>(scopeType) & static_cast<AZ::u64>(scope)) == static_cast<AZ::u64>(scope));
         }
 
-        const AZ::TypeId& GetUnderlyingTypeId(const IRttiHelper& enumRttiHelper)
+        AZ::TypeId GetUnderlyingTypeId(const IRttiHelper& enumRttiHelper)
         {
             const size_t underlyingTypeSize = enumRttiHelper.GetTypeSize();
             const TypeTraits underlyingTypeTraits = enumRttiHelper.GetTypeTraits();

+ 2 - 2
Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h

@@ -498,7 +498,7 @@ namespace AZ
 
     namespace Internal
     {
-        const AZ::TypeId& GetUnderlyingTypeId(const IRttiHelper& enumRttiHelper);
+        AZ::TypeId GetUnderlyingTypeId(const IRttiHelper& enumRttiHelper);
 
         // Converts sourceAddress to targetType
         inline bool ConvertValueTo(void* sourceAddress, const IRttiHelper* sourceRtti, const AZ::Uuid& targetType, void*& targetAddress, BehaviorParameter::TempValueParameterAllocator& tempAllocator)
@@ -1230,7 +1230,7 @@ namespace AZ
         template<class Getter, class Setter>
         bool Set(Getter getter, Setter setter, BehaviorClass* currentClass, BehaviorContext* context);
 
-        const AZ::Uuid& GetTypeId() const;
+        AZ::TypeId GetTypeId() const;
 
         AZStd::string m_name;
         BehaviorMethod* m_getter;

+ 43 - 43
Code/Framework/AzCore/AzCore/RTTI/RTTI.h

@@ -49,23 +49,23 @@ namespace AZ
     #define AZ_RTTI_COMMON()                                                                                                       \
     AZ_PUSH_DISABLE_WARNING(26433, "-Winconsistent-missing-override")                                                              \
     void RTTI_Enable();                                                                                                            \
-    virtual inline const AZ::TypeId& RTTI_GetType() const { return RTTI_Type(); }                                                  \
+    virtual inline        AZ::TypeId RTTI_GetType() const { return RTTI_Type(); }                                                  \
     virtual inline const char*      RTTI_GetTypeName() const { return RTTI_TypeName(); }                                           \
     virtual inline bool             RTTI_IsTypeOf(const AZ::TypeId & typeId) const { return RTTI_IsContainType(typeId); }          \
     virtual void                    RTTI_EnumTypes(AZ::RTTI_EnumCallback cb, void* userData) { RTTI_EnumHierarchy(cb, userData); } \
-    static inline const AZ::TypeId& RTTI_Type() { return TYPEINFO_Uuid(); }                                                        \
-    static inline const char*       RTTI_TypeName() { return TYPEINFO_Name(); }                                                    \
+    static inline constexpr AZ::TypeId RTTI_Type() { return TYPEINFO_Uuid(); }                                                     \
+    static inline constexpr const char*       RTTI_TypeName() { return TYPEINFO_Name(); }                                          \
     AZ_POP_DISABLE_WARNING
 
     //#define AZ_RTTI_1(_1)           static_assert(false,"You must provide a valid classUuid!")
 
     /// AZ_RTTI()
-    #define AZ_RTTI_1()             AZ_RTTI_COMMON()                                                                        \
-    static bool                 RTTI_IsContainType(const AZ::TypeId& id) { return id == RTTI_Type(); }                      \
-    static void                 RTTI_EnumHierarchy(AZ::RTTI_EnumCallback cb, void* userData) { cb(RTTI_Type(), userData); } \
-    AZ_PUSH_DISABLE_WARNING(26433, "-Winconsistent-missing-override")                                                       \
-    virtual inline const void*  RTTI_AddressOf(const AZ::TypeId& id) const { return (id == RTTI_Type()) ? this : nullptr; } \
-    virtual inline void*        RTTI_AddressOf(const AZ::TypeId& id) { return (id == RTTI_Type()) ? this : nullptr; }       \
+    #define AZ_RTTI_1()             AZ_RTTI_COMMON()                                                                                  \
+    static constexpr bool                 RTTI_IsContainType(const AZ::TypeId& id) { return id == RTTI_Type(); }                      \
+    static constexpr void                 RTTI_EnumHierarchy(AZ::RTTI_EnumCallback cb, void* userData) { cb(RTTI_Type(), userData); } \
+    AZ_PUSH_DISABLE_WARNING(26433, "-Winconsistent-missing-override")                                                                 \
+    virtual inline const void*  RTTI_AddressOf(const AZ::TypeId& id) const { return (id == RTTI_Type()) ? this : nullptr; }           \
+    virtual inline void*        RTTI_AddressOf(const AZ::TypeId& id) { return (id == RTTI_Type()) ? this : nullptr; }                 \
     AZ_POP_DISABLE_WARNING
 
     /// AZ_RTTI(BaseClass)
@@ -281,14 +281,14 @@ namespace AZ
     {
     public:
         virtual ~IRttiHelper() = default;
-        virtual const AZ::TypeId& GetActualUuid(const void* instance) const = 0;
+        virtual AZ::TypeId        GetActualUuid(const void* instance) const = 0;
         virtual const char*       GetActualTypeName(const void* instance) const = 0;
         virtual const void*       Cast(const void* instance, const AZ::TypeId& asType) const = 0;
         virtual void*             Cast(void* instance, const AZ::TypeId& asType) const = 0;
-        virtual const AZ::TypeId& GetTypeId() const = 0;
+        virtual AZ::TypeId        GetTypeId() const = 0;
         // If the type is an instance of a template this will return the type id of the template instead of the instance.
         // otherwise it return the regular type id.
-        virtual const AZ::TypeId& GetGenericTypeId() const = 0;
+        virtual AZ::TypeId        GetGenericTypeId() const = 0;
         virtual bool              IsTypeOf(const AZ::TypeId& id) const = 0;
         virtual bool              IsAbstract() const = 0;
         virtual bool              ProvidesFullRtti() const = 0;
@@ -338,7 +338,7 @@ namespace AZ
 
             //////////////////////////////////////////////////////////////////////////
             // IRttiHelper
-            const AZ::TypeId& GetActualUuid(const void* instance) const override
+            AZ::TypeId GetActualUuid(const void* instance) const override
             {
                 return instance
                     ? reinterpret_cast<const T*>(instance)->RTTI_GetType()
@@ -362,11 +362,11 @@ namespace AZ
                     ? reinterpret_cast<T*>(instance)->RTTI_AddressOf(asType)
                     : nullptr;
             }
-            const AZ::TypeId& GetTypeId() const override
+            AZ::TypeId GetTypeId() const override
             {
                 return T::RTTI_Type();
             }
-            const AZ::TypeId& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return AzTypeInfo<T>::template Uuid<AZ::GenericTypeIdTag>();
             }
@@ -407,7 +407,7 @@ namespace AZ
 
             //////////////////////////////////////////////////////////////////////////
             // IRttiHelper
-            const AZ::TypeId& GetActualUuid(const void*) const override
+            AZ::TypeId GetActualUuid(const void*) const override
             {
                 return AZ::AzTypeInfo<ValueType>::Uuid();
             }
@@ -423,11 +423,11 @@ namespace AZ
             {
                 return asType == GetTypeId() ? instance : nullptr;
             }
-            const AZ::TypeId& GetTypeId() const override
+            AZ::TypeId GetTypeId() const override
             {
                 return AZ::AzTypeInfo<ValueType>::Uuid();
             }
-            const AZ::TypeId& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return AZ::AzTypeInfo<ValueType>::template Uuid<AZ::GenericTypeIdTag>();
             }
@@ -462,7 +462,7 @@ namespace AZ
         struct ExternalVariadicRttiHelper
             : public IRttiHelper
         {
-            const AZ::TypeId& GetActualUuid(const void*) const override
+            AZ::TypeId GetActualUuid(const void*) const override
             {
                 return AZ::AzTypeInfo<T>::Uuid();
             }
@@ -485,12 +485,12 @@ namespace AZ
                 return const_cast<void*>(Cast(const_cast<const void*>(instance), asType));
             }
 
-            const AZ::TypeId& GetTypeId() const override
+            AZ::TypeId GetTypeId() const override
             {
                 return AZ::AzTypeInfo<T>::Uuid();
             }
 
-            const AZ::TypeId& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return AZ::AzTypeInfo<T>::template Uuid<AZ::GenericTypeIdTag>();
             }
@@ -741,17 +741,17 @@ namespace AZ
                 return id == AzTypeInfo<SrcType>::Uuid();
             }
 
-            static inline const AZ::TypeId& Type(const U& ref, const AZStd::integral_constant<RttiKind, RttiKind::Intrusive>& /* HasAZRttiIntrusive<U> */)
+            static inline AZ::TypeId Type(const U& ref, const AZStd::integral_constant<RttiKind, RttiKind::Intrusive>& /* HasAZRttiIntrusive<U> */)
             {
                 return ref.RTTI_GetType();
             }
 
-            static inline const AZ::TypeId& Type(const U&, const AZStd::integral_constant<RttiKind, RttiKind::External>& /* HasAZRttiExternal<U> */)
+            static inline AZ::TypeId Type(const U&, const AZStd::integral_constant<RttiKind, RttiKind::External>& /* HasAZRttiExternal<U> */)
             {
                 return RttiHelper<U>().GetTypeId();
             }
 
-            static inline const AZ::TypeId& Type(const U&, const AZStd::integral_constant<RttiKind, RttiKind::None>& /* !HasAZRtti<U> */)
+            static inline AZ::TypeId Type(const U&, const AZStd::integral_constant<RttiKind, RttiKind::None>& /* !HasAZRtti<U> */)
             {
                 typedef typename RttiRemoveQualifiers<U>::type SrcType;
                 return AzTypeInfo<SrcType>::Uuid();
@@ -777,19 +777,19 @@ namespace AZ
                 return id == AzTypeInfo<SrcType>::Uuid();
             }
 
-            static inline const AZ::TypeId& Type(U* ptr, const AZStd::integral_constant<RttiKind, RttiKind::Intrusive>& /* HasAZRttiIntrusive<U> */)
+            static inline AZ::TypeId Type(U* ptr, const AZStd::integral_constant<RttiKind, RttiKind::Intrusive>& /* HasAZRttiIntrusive<U> */)
             {
                 static AZ::TypeId s_invalidUuid = AZ::TypeId::CreateNull();
                 return ptr ? ptr->RTTI_GetType() : s_invalidUuid;
             }
 
-            static inline const AZ::TypeId& Type(U* ptr, const AZStd::integral_constant<RttiKind, RttiKind::External>& /* HasAZRttiExternal<U> */)
+            static inline AZ::TypeId Type(U* ptr, const AZStd::integral_constant<RttiKind, RttiKind::External>& /* HasAZRttiExternal<U> */)
             {
                 static AZ::TypeId s_invalidUuid = AZ::TypeId::CreateNull();
                 return ptr ? RttiHelper<U>().GetTypeId() : s_invalidUuid;
             }
 
-            static inline const AZ::TypeId& Type(U*, const AZStd::integral_constant<RttiKind, RttiKind::None>& /* !HasAZRtti<U> */)
+            static inline AZ::TypeId Type(U*, const AZStd::integral_constant<RttiKind, RttiKind::None>& /* !HasAZRtti<U> */)
             {
                 typedef typename RttiRemoveQualifiers<U>::type SrcType;
                 return AzTypeInfo<SrcType>::Uuid();
@@ -803,7 +803,7 @@ namespace AZ
         }
 
         template<class T>
-        void RttiEnumHierarchyHelper(RTTI_EnumCallback cb, void* userData, const AZStd::false_type& /* HasAZRtti<T> */)
+        constexpr void RttiEnumHierarchyHelper(RTTI_EnumCallback cb, void* userData, const AZStd::false_type& /* HasAZRtti<T> */)
         {
             cb(AzTypeInfo<T>::Uuid(), userData);
         }
@@ -812,12 +812,12 @@ namespace AZ
         template<class T, RttiKind rttiKind = HasAZRtti<T>::kind_type::value>
         struct RttiCaller
         {
-            AZ_FORCE_INLINE static bool RTTI_IsContainType(const AZ::TypeId& id)
+            AZ_FORCE_INLINE static constexpr bool RTTI_IsContainType(const AZ::TypeId& id)
             {
                 return T::RTTI_IsContainType(id);
             }
 
-            AZ_FORCE_INLINE static void RTTI_EnumHierarchy(AZ::RTTI_EnumCallback cb, void* userData)
+            AZ_FORCE_INLINE static constexpr void RTTI_EnumHierarchy(AZ::RTTI_EnumCallback cb, void* userData)
             {
                 T::RTTI_EnumHierarchy(cb, userData);
             }
@@ -861,34 +861,34 @@ namespace AZ
         template<class T>
         struct RttiCaller<T, RttiKind::None>
         {
-            AZ_FORCE_INLINE static bool RTTI_IsContainType(const AZ::TypeId&)
+            AZ_FORCE_INLINE static constexpr bool RTTI_IsContainType(const AZ::TypeId&)
             {
                 return false;
             }
 
-            AZ_FORCE_INLINE static void RTTI_EnumHierarchy(AZ::RTTI_EnumCallback, void*)
+            AZ_FORCE_INLINE static constexpr void RTTI_EnumHierarchy(AZ::RTTI_EnumCallback, void*)
             {
             }
 
-            AZ_FORCE_INLINE static const void* RTTI_AddressOf(const T*, const AZ::TypeId&)
+            AZ_FORCE_INLINE static constexpr const void* RTTI_AddressOf(const T*, const AZ::TypeId&)
             {
                 return nullptr;
             }
 
-            AZ_FORCE_INLINE static void* RTTI_AddressOf(T*, const AZ::TypeId&)
+            AZ_FORCE_INLINE static constexpr void* RTTI_AddressOf(T*, const AZ::TypeId&)
             {
                 return nullptr;
             }
         };
 
         template<class U, typename TypeIdResolverTag, typename AZStd::enable_if_t<AZStd::is_same_v<TypeIdResolverTag, AZStd::false_type>>* = nullptr>
-        inline const AZ::TypeId& RttiTypeId()
+        inline constexpr AZ::TypeId RttiTypeId()
         {
             return AzTypeInfo<U>::Uuid();
         }
 
         template<class U, typename TypeIdResolverTag, typename AZStd::enable_if_t<!AZStd::is_same_v<TypeIdResolverTag, AZStd::false_type>>* = nullptr>
-        inline const AZ::TypeId& RttiTypeId()
+        inline constexpr AZ::TypeId RttiTypeId()
         {
             return AzTypeInfo<U>::template Uuid<TypeIdResolverTag>();
         }
@@ -960,13 +960,13 @@ namespace AZ
     // TypeIdResolverTag is one of the TypeIdResolverTags such as CanonicalTypeIdTag. If false_type is provided the default on assigned
     // by the type will be used.
     template<class U, typename TypeIdResolverTag = AZStd::false_type>
-    inline const AZ::TypeId& RttiTypeId()
+    inline constexpr AZ::TypeId RttiTypeId()
     {
         return AZ::Internal::RttiTypeId<U, TypeIdResolverTag>();
     }
 
     template<template<typename...> class U, typename = void>
-    inline const AZ::TypeId& RttiTypeId()
+    inline constexpr AZ::TypeId RttiTypeId()
     {
         return AzGenericTypeInfo::Uuid<U>();
     }
@@ -978,31 +978,31 @@ namespace AZ
     #else
     template<template<auto...> class U, typename = void>
     #endif // defined(AZ_COMPILER_MSVC)
-    inline const AZ::TypeId& RttiTypeId()
+    inline constexpr AZ::TypeId RttiTypeId()
     {
         return AzGenericTypeInfo::Uuid<U>();
     }
 
     template<template<typename, auto> class U, typename = void>
-    inline const AZ::TypeId& RttiTypeId()
+    inline constexpr AZ::TypeId RttiTypeId()
     {
         return AzGenericTypeInfo::Uuid<U>();
     }
 
     template<template<typename, typename, auto> class U, typename = void>
-    inline const AZ::TypeId& RttiTypeId()
+    inline constexpr AZ::TypeId RttiTypeId()
     {
         return AzGenericTypeInfo::Uuid<U>();
     }
 
     template<template<typename, typename, typename, auto> class U, typename = void>
-    inline const AZ::TypeId& RttiTypeId()
+    inline constexpr AZ::TypeId RttiTypeId()
     {
         return AzGenericTypeInfo::Uuid<U>();
     }
 
     template<class U>
-    inline const AZ::TypeId& RttiTypeId(const U& data)
+    inline AZ::TypeId RttiTypeId(const U& data)
     {
         return AZ::Internal::RttiIsTypeOfIdHelper<U>::Type(data, typename HasAZRtti<AZStd::remove_pointer_t<U>>::kind_type());
     }

+ 271 - 287
Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h

@@ -9,6 +9,8 @@
 
 #include <AzCore/std/containers/array.h>
 #include <AzCore/Preprocessor/Enum.h>
+#include <AzCore/std/ranges/join_with_view.h>
+#include <AzCore/std/ranges/reverse_view.h>
 #include <AzCore/std/typetraits/is_pointer.h>
 #include <AzCore/std/typetraits/is_const.h>
 #include <AzCore/std/typetraits/is_enum.h>
@@ -215,17 +217,16 @@ namespace AZ
         template <template <typename, auto, typename> class> constexpr bool false_v6 = false;
 
         template<typename T>
-        inline const AZ::TypeId& Uuid()
+        inline constexpr AZ::TypeId Uuid()
         {
             return AzTypeInfo<T>::template Uuid<AZ::GenericTypeIdTag>();
         }
 
         template<template<typename...> class T>
-        inline const AZ::TypeId& Uuid()
+        inline constexpr AZ::TypeId Uuid()
         {
             static_assert(false_v1<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
-            static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
-            return s_uuid;
+            return {};
         }
 #if defined(AZ_COMPILER_MSVC)
         // There is a bug with the MSVC compiler when using the 'auto' keyword here. It appears that MSVC is unable to distinguish between a template
@@ -234,44 +235,38 @@ namespace AZ
 #else
         template<template<auto...> class T>
 #endif // defined(AZ_COMPILER_MSVC)
-        inline const AZ::TypeId& Uuid()
+        inline constexpr AZ::TypeId Uuid()
         {
             static_assert(false_v2<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
-            static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
-            return s_uuid;
+            return {};
         }
 
-
         template<template<typename, auto> class T>
-        inline const AZ::TypeId& Uuid()
+        inline constexpr AZ::TypeId Uuid()
         {
             static_assert(false_v3<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
-            static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
-            return s_uuid;
+            return {};
         }
 
         template<template<typename, typename, auto> class T>
-        inline const AZ::TypeId& Uuid()
+        inline constexpr AZ::TypeId Uuid()
         {
             static_assert(false_v4<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
-            static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
-            return s_uuid;
+            return {};
         }
 
         template<template<typename, typename, typename, auto> class T>
-        inline const AZ::TypeId& Uuid()
+        inline constexpr AZ::TypeId Uuid()
         {
             static_assert(false_v5<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
-            static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
-            return s_uuid;
+            return {};
         }
 
         template<template<typename, auto, typename> class T>
-        inline const AZ::TypeId& Uuid()
+        inline constexpr AZ::TypeId Uuid()
         {
             static_assert(false_v6<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
-            static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
-            return s_uuid;
+            return {};
         }
     }
 
@@ -326,67 +321,72 @@ namespace AZ
             *destination = 0;
         }
 
-        template<class... Tn>
-        struct AggregateTypes;
+        constexpr AZStd::string_view TypeNameSeparator = ", ";
 
-        template<class T1, class... Tn>
-        struct AggregateTypes<T1, Tn...>
+        template<class... Tn>
+        struct AggregateTypes
         {
-            static constexpr void TypeNameWithSeparator(char* buffer, size_t bufferSize)
-            {
-                constexpr const char* separator = ", ";
-                AzTypeInfoSafeCat(buffer, bufferSize, separator);
-                AzTypeInfoSafeCat(buffer, bufferSize, AzTypeInfo<T1>::Name());
-                AggregateTypes<Tn...>::TypeNameWithSeparator(buffer, bufferSize);
-            }
-
-            static constexpr void TypeName(char* buffer, size_t bufferSize)
-            {
-                AzTypeInfoSafeCat(buffer, bufferSize, AzTypeInfo<T1>::Name());
-                AggregateTypes<Tn...>::TypeNameWithSeparator(buffer, bufferSize);
-            }
-
-            template<typename TypeIdResolverTag = CanonicalTypeIdTag>
-            static AZ::TypeId Uuid()
+            static constexpr auto TypeName()
             {
-                const AZ::TypeId tail = AggregateTypes<Tn...>::template Uuid<TypeIdResolverTag>();
-                if (!tail.IsNull())
+                if constexpr (sizeof...(Tn) == 0)
                 {
-                    // Avoid accumulating a null uuid, since it affects the result.
-                    return AzTypeInfo<T1>::template Uuid<TypeIdResolverTag>() + tail;
+                    return AZStd::string_view{};
                 }
                 else
                 {
-                    return AzTypeInfo<T1>::template Uuid<TypeIdResolverTag>();
+                    constexpr AZStd::fixed_string<1024> typeNameAggregate = []()
+                    {
+                        constexpr auto typeNames = AZStd::to_array({ AZStd::string_view(AzTypeInfo<Tn>::Name())... });
+                        return AZStd::fixed_string<1024>(AZStd::from_range, typeNames | AZStd::views::join_with(TypeNameSeparator));
+                    }();
+
+                    // resize down the aggregate type name to the exact size
+                    return AZStd::fixed_string<typeNameAggregate.size()>(typeNameAggregate);
                 }
             }
-        };
-
-        template<>
-        struct AggregateTypes<>
-        {
-            static constexpr void TypeNameWithSeparator(char*, size_t)
-            {
-            }
-            static constexpr void TypeName(char*, size_t)
-            {
-            }
 
             template<typename TypeIdResolverTag = CanonicalTypeIdTag>
-            static AZ::TypeId Uuid()
+            static constexpr AZ::TypeId Uuid()
             {
-                return AZ::TypeId::CreateNull();
+                if constexpr (sizeof...(Tn) == 0)
+                {
+                    return {};
+                }
+                else
+                {
+                    constexpr auto typeIds = AZStd::to_array<AZ::TypeId>({ AzTypeInfo<Tn>::template Uuid<TypeIdResolverTag>()... });
+                    if (typeIds.empty())
+                    {
+                        return {};
+                    }
+
+                    AZ::TypeId aggregateTypeId = typeIds.back();
+
+                    // perform binary right fold over all the type ids, by combining them
+                    // two elements at a time from the end of the array to the beginning
+                    // Skip over the last element and reverse the span
+                    for (const AZ::TypeId& prevTypeId : AZStd::span(typeIds.data(), typeIds.size() - 1) | AZStd::views::reverse)
+                    {
+                        if (!aggregateTypeId.IsNull())
+                        {
+                            // Avoid accumulating a null uuid, since it affects the result.
+                            aggregateTypeId = prevTypeId + aggregateTypeId;
+                        }
+                        else
+                        {
+                            // Otherwise replace the aggregate type id with the previous typeid
+                            aggregateTypeId = prevTypeId;
+                        }
+                    }
+
+                    return aggregateTypeId;
+                }
             }
         };
 
-        using TypeIdHolder = AZ::TypeId;
 
         // Represents the "*" typeid that can be combined with non-pointer types T to form a unique T* typeid
-        inline static const AZ::TypeId& PointerTypeId()
-        {
-            static TypeIdHolder s_uuid("{35C8A027-FE00-4769-AE36-6997CFFAF8AE}");
-            return s_uuid;
-        }
+        inline constexpr AZ::TypeId PointerTypeId_v{ "{35C8A027-FE00-4769-AE36-6997CFFAF8AE}" };
 
         template<typename T>
         constexpr const char* GetTypeName()
@@ -394,51 +394,55 @@ namespace AZ
             return AZ::AzTypeInfo<T>::Name();
         }
 
-        template<int N, bool Recursion = false>
+        template<int N, bool MoreDigits = (N >= 10)>
         struct NameBufferSize
         {
-            static constexpr int Size = 1 + NameBufferSize<N / 10, true>::Size;
+            static constexpr int Size = 1 + NameBufferSize<N / 10>::Size;
         };
-        template<> struct NameBufferSize<0, false> { static constexpr const int Size = 2; };
-        template<> struct NameBufferSize<0, true> { static constexpr const int Size = 1; };
+        template<int N> struct NameBufferSize<N, false> { static constexpr int Size = 1; };
 
         // IntTypeName provides Compile time Variable template for c-string
         // of a converted unsigned integer value
         template<AZStd::size_t N>
-        inline constexpr AZStd::array<char, NameBufferSize<N>::Size> IntTypeName = []() constexpr
-            -> AZStd::array<char, NameBufferSize<N>::Size>
+        inline constexpr AZStd::fixed_string<NameBufferSize<N>::Size> IntTypeName = []() constexpr
             {
-                using BufferType = AZStd::array<char, NameBufferSize<N>::Size>;
-                BufferType buffer{};
-                // Fill the buffer from the end with stringified
-                // conversions of each digit
-                // The buffer is exactly the size to store a null-terminated string
-                // of the integer converted to a string
-                size_t index = buffer.size() - 1;
-                for (size_t value = N; index > 0; value /= 10)
+                using BufferType = AZStd::fixed_string<NameBufferSize<N>::Size>;
+                BufferType numberString;
+                auto FillDigitsFromEnd = [](char* buffer, size_t bufferSize)
                 {
-                    buffer[--index] = '0' + (value % 10);
-                }
-                return buffer;
+                    // Fill the buffer from the end with stringified
+                    // conversions of each digit
+                    // The buffer is exactly the size to store the integer converted to a string
+                    size_t index = bufferSize;
+                    for (size_t value = N; index > 0; value /= 10)
+                    {
+                        buffer[--index] = '0' + (value % 10);
+                    }
+                    return bufferSize;
+                };
+                numberString.resize_and_overwrite(numberString.max_size(), FillDigitsFromEnd);
+                return numberString;
             }();
 
         template<AZStd::size_t N>
         constexpr const char* GetTypeName()
         {
-            return IntTypeName<N>.data();
+            return IntTypeName<N>.c_str();
         }
 
         template<typename T, typename TypeIdResolverTag>
-        const AZ::TypeId& GetTypeId()
+        constexpr AZ::TypeId GetTypeId()
         {
             return AZ::AzTypeInfo<T>::template Uuid<TypeIdResolverTag>();
         }
 
+        template<AZStd::size_t N>
+        inline constexpr AZ::TypeId NumericTypeId_v = AZ::TypeId::CreateName(GetTypeName<N>());
+
         template<AZStd::size_t N, typename>
-        const AZ::TypeId& GetTypeId()
+        constexpr AZ::TypeId GetTypeId()
         {
-            static AZ::TypeId uuid = AZ::TypeId::CreateName(GetTypeName<N>());
-            return uuid;
+            return NumericTypeId_v<N>;
         }
 
     } // namespace Internal
@@ -484,7 +488,7 @@ namespace AZ
             return T::TYPEINFO_Name();
         }
         template<typename TypeIdResolverTag = CanonicalTypeIdTag>
-        static const AZ::TypeId& Uuid()
+        static constexpr AZ::TypeId Uuid()
         {
             static_assert(AZ::Internal::HasAZTypeInfoIntrusive<T>,
                 "You should use AZ_TYPE_INFO or AZ_RTTI in your class/struct, or use AZ_TYPE_INFO_SPECIALIZE() externally. "
@@ -510,7 +514,11 @@ namespace AZ
     template <class T>
     struct AzTypeInfo<T, true /* is_enum */>
     {
+    private:
         typedef typename AZStd::RemoveEnum<T>::type UnderlyingType;
+        // Used to provide a reference to a Uuid with a null value = {00000000-0000-0000-0000-000000000000}
+        inline static constexpr AZ::TypeId s_nullTypeId_v;
+    public:
         static constexpr const char* Name()
         {
             if constexpr (AZ::HasAzEnumTraits_v<T>)
@@ -522,8 +530,9 @@ namespace AZ
                 return "[enum]";
             }
         }
+
         template<typename TypeIdResolverTag = CanonicalTypeIdTag>
-        static const AZ::TypeId& Uuid() { static AZ::TypeId nullUuid = AZ::TypeId::CreateNull(); return nullUuid; }
+        static constexpr AZ::TypeId Uuid() { return s_nullTypeId_v; }
         static constexpr TypeTraits GetTypeTraits()
         {
             TypeTraits typeTraits{};
@@ -541,13 +550,13 @@ namespace AZ
     };
 
     template<class T, class U>
-    inline bool operator==(AzTypeInfo<T> const& lhs, AzTypeInfo<U> const& rhs)
+    constexpr inline bool operator==(AzTypeInfo<T> const& lhs, AzTypeInfo<U> const& rhs)
     {
         return lhs.Uuid() == rhs.Uuid();
     }
 
     template<class T, class U>
-    inline bool operator!=(AzTypeInfo<T> const& lhs, AzTypeInfo<U> const& rhs)
+    constexpr inline bool operator!=(AzTypeInfo<T> const& lhs, AzTypeInfo<U> const& rhs)
     {
         return lhs.Uuid() != rhs.Uuid();
     }
@@ -579,11 +588,14 @@ namespace AZ
     template<>                                                        \
     struct AzTypeInfo<_ClassName, AZStd::is_enum<_ClassName>::value>  \
     {                                                                 \
-        static constexpr const char* Name() { return #_ClassName; }    \
+    private:                                                          \
+        static inline constexpr AZ::TypeId s_classUuid{_ClassUuid};   \
+    public:                                                           \
+        static constexpr const char* Name() { return #_ClassName; }   \
         template<typename TypeIdResolverTag = CanonicalTypeIdTag>     \
-        static const AZ::TypeId& Uuid() {                             \
-            static AZ::Internal::TypeIdHolder s_uuid(_ClassUuid);     \
-            return s_uuid;                                            \
+        static constexpr AZ::TypeId Uuid()                            \
+        {                                                             \
+            return s_classUuid;                                       \
         }                                                             \
         static constexpr TypeTraits GetTypeTraits()                   \
         {                                                             \
@@ -595,9 +607,9 @@ namespace AZ
         }                                                             \
         static constexpr size_t Size()                                \
         {                                                             \
-            return AZ::Internal::TypeInfoSizeof<_ClassName>::Size();      \
+            return AZ::Internal::TypeInfoSizeof<_ClassName>::Size();  \
         }                                                             \
-        static bool Specialized() { return true; }                    \
+        static constexpr bool Specialized() { return true; }          \
     };
 
     // specialize for function pointers
@@ -616,37 +628,34 @@ namespace AZ
                 // is returned from the compile time calculations
                 constexpr auto combineTypeNameBuffer = []() constexpr
                 {
-                    using CombineBufferType = AZStd::array<char, 1024>;
-                    CombineBufferType typeName{};
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), "{");
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), AZ::AzTypeInfo<R>::Name());
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), "(");
-                    AZ::Internal::AggregateTypes<Args...>::TypeName(typeName.data(), typeName.size());
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), ")}");
+                    using CombineBufferType = AZStd::fixed_string<1024>;
+                    CombineBufferType typeName{ '{' };
+                    typeName += AZ::AzTypeInfo<R>::Name();
+                    typeName += '(';
+                    typeName += AZ::Internal::AggregateTypes<Args...>::TypeName();
+                    typeName += ")}";
                     return typeName;
                 }();
 
-                // Create a buffer that can store the exact number of characters for the type name + NUL
-                constexpr size_t NameLength = AZStd::char_traits<char>::length(combineTypeNameBuffer.data());
-                AZStd::array<char, NameLength + 1> resultBuffer{};
-                AZStd::copy(combineTypeNameBuffer.begin(), combineTypeNameBuffer.begin() + NameLength, resultBuffer.begin());
-                return resultBuffer;
+                // Round up to the Next Power of 2 to reduce the number of fixed_string template instantiations
+                return AZStd::fixed_string<AZ::AlignUpToPowerOfTwo(combineTypeNameBuffer.size())>(combineTypeNameBuffer);
             }();
             constexpr const char* operator()() const
             {
-                return TypeName.data();
+                return TypeName.c_str();
             }
         };
+        template<class TypeIdResolverTag>
+        static inline constexpr TypeId s_uuid_v = AZ::Internal::AggregateTypes<R, Args...>::template Uuid<TypeIdResolverTag>();
     public:
         static constexpr const char* Name()
         {
             return TypeNameInternal{}();
         }
         template<typename TypeIdResolverTag = CanonicalTypeIdTag>
-        static const AZ::TypeId& Uuid()
+        static constexpr AZ::TypeId Uuid()
         {
-            static AZ::Internal::TypeIdHolder s_uuid(AZ::Internal::AggregateTypes<R, Args...>::template Uuid<TypeIdResolverTag>());
-            return s_uuid;
+            return s_uuid_v<TypeIdResolverTag>;
         }
         static constexpr TypeTraits GetTypeTraits()
         {
@@ -734,40 +743,36 @@ namespace AZ
             {
                 constexpr auto combineTypeNameBuffer = []() constexpr
                 {
-                    using CombineBufferType = AZStd::array<char, 1024>;
-                    CombineBufferType typeName{};
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), "{");
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), AZ::AzTypeInfo<R>::Name());
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), "(");
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), AZ::AzTypeInfo<C>::Name());
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), "::*)");
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), "(");
-                    AZ::Internal::AggregateTypes<Args...>::TypeName(typeName.data(), typeName.size());
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), ")}");
+                    using CombineBufferType = AZStd::fixed_string<1024>;
+                    CombineBufferType typeName{ '{' };
+                    typeName += AZ::AzTypeInfo<R>::Name();
+                    typeName += '(';
+                    typeName += AZ::AzTypeInfo<C>::Name();
+                    typeName += "::*)(";
+                    typeName += AZ::Internal::AggregateTypes<Args...>::TypeName();
+                    typeName += ")}";
                     return typeName;
                 }();
 
-                // Create a buffer that can store the exact number of characters for the type name + NUL
-                constexpr size_t NameLength = AZStd::char_traits<char>::length(combineTypeNameBuffer.data());
-                AZStd::array<char, NameLength + 1> resultBuffer{};
-                AZStd::copy(combineTypeNameBuffer.begin(), combineTypeNameBuffer.begin() + NameLength, resultBuffer.begin());
-                return resultBuffer;
+                // Round up to the Next Power of 2 to reduce the number of fixed_string template instantiations
+                return AZStd::fixed_string<AZ::AlignUpToPowerOfTwo(combineTypeNameBuffer.size())>(combineTypeNameBuffer);
             }();
             constexpr const char* operator()() const
             {
-                return TypeName.data();
+                return TypeName.c_str();
             }
         };
+        template<class TypeIdResolverTag>
+        inline static constexpr AZ::TypeId s_uuid_v{ AZ::Internal::AggregateTypes<R, C, Args...>::template Uuid<TypeIdResolverTag>() };
     public:
         static constexpr const char* Name()
         {
             return TypeNameInternal{}();
         }
         template<typename TypeIdResolverTag = CanonicalTypeIdTag>
-        static const AZ::TypeId& Uuid()
+        static constexpr AZ::TypeId Uuid()
         {
-            static AZ::Internal::TypeIdHolder s_uuid(AZ::Internal::AggregateTypes<R, C, Args...>::template Uuid<TypeIdResolverTag>());
-            return s_uuid;
+            return s_uuid_v<TypeIdResolverTag>;
         }
         static constexpr TypeTraits GetTypeTraits()
         {
@@ -798,37 +803,34 @@ namespace AZ
             {
                 constexpr auto combineTypeNameBuffer = []() constexpr
                 {
-                    using CombineBufferType = AZStd::array<char, 1024>;
-                    CombineBufferType typeName{};
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), "{");
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), AZ::AzTypeInfo<R>::Name());
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), " ");
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), AZ::AzTypeInfo<C>::Name());
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), "::*}");
+                    using CombineBufferType = AZStd::fixed_string<1024>;
+                    CombineBufferType typeName{ '{' };
+                    typeName += AZ::AzTypeInfo<R>::Name();
+                    typeName += ' ';
+                    typeName + AZ::AzTypeInfo<C>::Name();
+                    typeName += "::*}";
                     return typeName;
                 }();
 
-                // Create a buffer that can store the exact number of characters for the type name + NUL
-                constexpr size_t NameLength = AZStd::char_traits<char>::length(combineTypeNameBuffer.data());
-                AZStd::array<char, NameLength + 1> resultBuffer{};
-                AZStd::copy(combineTypeNameBuffer.begin(), combineTypeNameBuffer.begin() + NameLength, resultBuffer.begin());
-                return resultBuffer;
+                // Round up to the Next Power of 2 to reduce the number of fixed_string template instantiations
+                return AZStd::fixed_string<AZ::AlignUpToPowerOfTwo(combineTypeNameBuffer.size())>(combineTypeNameBuffer);
             }();
             constexpr const char* operator()() const
             {
-                return TypeName.data();
+                return TypeName.c_str();
             }
         };
+        template<class TypeIdResolverTag>
+        inline static constexpr TypeId s_uuid_v{ AZ::Internal::AggregateTypes<R, C>::template Uuid<TypeIdResolverTag>() };
     public:
         static constexpr const char* Name()
         {
             return TypeNameInternal{}();
         }
         template<typename TypeIdResolverTag = CanonicalTypeIdTag>
-        static const AZ::TypeId& Uuid()
+        static constexpr AZ::TypeId Uuid()
         {
-            static AZ::Internal::TypeIdHolder s_uuid(AZ::Internal::AggregateTypes<R, C>::template Uuid<TypeIdResolverTag>());
-            return s_uuid;
+            return s_uuid_v<TypeIdResolverTag>;
         }
         static constexpr TypeTraits GetTypeTraits()
         {
@@ -854,24 +856,26 @@ namespace AZ
             {                                                                                                    \
                 constexpr auto combineTypeNameBuffer = []() constexpr                                            \
                 {                                                                                                \
-                    using CombineBufferType = AZStd::array<char, 1024>;                                          \
-                    CombineBufferType typeName{};                                                                \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), _NamePrefix);              \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), AzTypeInfo<_T1>::Name());  \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), _NameSuffix);              \
+                    using CombineBufferType = AZStd::fixed_string<1024>;                                         \
+                    CombineBufferType typeName{ _NamePrefix };                                                   \
+                    typeName += AzTypeInfo<_T1>::Name();                                                         \
+                    typeName += _NameSuffix;                                                                     \
                     return typeName;                                                                             \
                 }();                                                                                             \
-                /* Create a buffer that can store the exact number of characters for the type name + NUL */      \
-                constexpr size_t NameLength = AZStd::char_traits<char>::length(combineTypeNameBuffer.data());    \
-                AZStd::array<char, NameLength + 1> resultBuffer{};                                               \
-                AZStd::copy(combineTypeNameBuffer.begin(), combineTypeNameBuffer.begin() + NameLength, resultBuffer.begin()); \
-                return resultBuffer;                                                                             \
+                /* Round up to power of 2 to reduce the number of fixed_string template instantiations */        \
+                return AZStd::fixed_string<AZ::AlignUpToPowerOfTwo(combineTypeNameBuffer.size())>(combineTypeNameBuffer); \
             }();                                                                                                 \
             constexpr const char* operator()() const                                                             \
             {                                                                                                    \
-                return TypeName.data();                                                                          \
+                return TypeName.c_str();                                                                         \
             }                                                                                                    \
         };                                                                                                       \
+        template<class TypeIdResolverTag>                                                                        \
+        inline static constexpr AZ::TypeId s_uuid_v{                                                             \
+                !AZStd::is_same_v<TypeIdResolverTag, PointerRemovedTypeIdTag>                                    \
+                && AZStd::is_pointer_v<_Specialization> ?                                                        \
+                AZ::AzTypeInfo<_T1>::template Uuid<TypeIdResolverTag>() + AZ::Internal::PointerTypeId_v :        \
+                AZ::AzTypeInfo<_T1>::template Uuid<TypeIdResolverTag>()};                                        \
     public:                                                                                                      \
         static constexpr const char* Name()                                                                      \
         {                                                                                                        \
@@ -881,13 +885,10 @@ namespace AZ
         * By default the specialization for pointer types defaults to PointerRemovedTypeIdTag                    \
         * This allows the current use of AzTypeInfo<T*>::Uuid to still return the typeid of type                 \
         */                                                                                                       \
-        template<typename TypeIdResolverTag = PointerRemovedTypeIdTag>                                           \
-        static const AZ::TypeId& Uuid() {                                                                        \
-            static AZ::Internal::TypeIdHolder s_uuid(                                                            \
-                !AZStd::is_same<TypeIdResolverTag, PointerRemovedTypeIdTag>::value                               \
-                && AZStd::is_pointer<_Specialization>::value ?                                                   \
-                AZ::AzTypeInfo<_T1>::template Uuid<TypeIdResolverTag>() + AZ::Internal::PointerTypeId() : AZ::AzTypeInfo<_T1>::template Uuid<TypeIdResolverTag>()); \
-            return s_uuid;                                                                                       \
+        template<typename Tag = PointerRemovedTypeIdTag>                                                         \
+        static constexpr AZ::TypeId Uuid()                                                                       \
+        {                                                                                                        \
+            return s_uuid_v<Tag>;                                                                                \
         }                                                                                                        \
         static constexpr TypeTraits GetTypeTraits()                                                              \
         {                                                                                                        \
@@ -904,36 +905,36 @@ namespace AZ
     }
 
     // Helper macros to generically specialize template types
-#define  AZ_TYPE_INFO_INTERNAL_VARIATION_GENERIC(_Generic, _Uuid)                                                       \
-    namespace AzGenericTypeInfo {                                                                                       \
-        template<>                                                                                                      \
-        inline const AZ::TypeId& Uuid<_Generic>(){ static AZ::Internal::TypeIdHolder s_uuid(_Uuid); return s_uuid; }    \
+#define  AZ_TYPE_INFO_INTERNAL_VARIATION_GENERIC(_Generic, _Uuid)                 \
+    namespace AzGenericTypeInfo {                                                 \
+        template<>                                                                \
+        inline constexpr AZ::TypeId Uuid<_Generic>(){ return AZ::TypeId(_Uuid); } \
     }
 
 #define AZ_TYPE_INFO_INTERNAL_TYPENAME__TYPE typename
 #define AZ_TYPE_INFO_INTERNAL_TYPENAME__ARG(A) A
 #define AZ_TYPE_INFO_INTERNAL_TYPENAME__UUID(Tag, A) AZ::Internal::GetTypeId< A , Tag >()
-#define AZ_TYPE_INFO_INTERNAL_TYPENAME__NAME(A) AZ::Internal::AzTypeInfoSafeCat(AZStd::data(typeName), AZStd::size(typeName), AZ::Internal::GetTypeName< A >())
+#define AZ_TYPE_INFO_INTERNAL_TYPENAME__NAME(A) AZ::Internal::GetTypeName< A >()
 
 #define AZ_TYPE_INFO_INTERNAL_CLASS__TYPE class
 #define AZ_TYPE_INFO_INTERNAL_CLASS__ARG(A) A
 #define AZ_TYPE_INFO_INTERNAL_CLASS__UUID(Tag, A) AZ::Internal::GetTypeId< A , Tag >()
-#define AZ_TYPE_INFO_INTERNAL_CLASS__NAME(A) AZ::Internal::AzTypeInfoSafeCat(AZStd::data(typeName), AZStd::size(typeName), AZ::Internal::GetTypeName< A >())
+#define AZ_TYPE_INFO_INTERNAL_CLASS__NAME(A) AZ::Internal::GetTypeName< A >()
 
 #define AZ_TYPE_INFO_INTERNAL_TYPENAME_VARARGS__TYPE typename...
 #define AZ_TYPE_INFO_INTERNAL_TYPENAME_VARARGS__ARG(A) A...
 #define AZ_TYPE_INFO_INTERNAL_TYPENAME_VARARGS__UUID(Tag, A) AZ::Internal::AggregateTypes< A... >::template Uuid< Tag >()
-#define AZ_TYPE_INFO_INTERNAL_TYPENAME_VARARGS__NAME(A) AZ::Internal::AggregateTypes< A... >::TypeName(AZStd::data(typeName), AZStd::size(typeName))
+#define AZ_TYPE_INFO_INTERNAL_TYPENAME_VARARGS__NAME(A) AZ::Internal::AggregateTypes< A... >::TypeName()
 
 #define AZ_TYPE_INFO_INTERNAL_CLASS_VARARGS__TYPE class...
 #define AZ_TYPE_INFO_INTERNAL_CLASS_VARARGS__ARG(A) A...
 #define AZ_TYPE_INFO_INTERNAL_CLASS_VARARGS__UUID(Tag, A) AZ::Internal::AggregateTypes< A... >::template Uuid< Tag >()
-#define AZ_TYPE_INFO_INTERNAL_CLASS_VARARGS__NAME(A) AZ::Internal::AggregateTypes< A... >::TypeName(AZStd::data(typeName), AZStd::size(typeName));
+#define AZ_TYPE_INFO_INTERNAL_CLASS_VARARGS__NAME(A) AZ::Internal::AggregateTypes< A... >::TypeName()
 
 #define AZ_TYPE_INFO_INTERNAL_AUTO__TYPE auto
 #define AZ_TYPE_INFO_INTERNAL_AUTO__ARG(A) A
 #define AZ_TYPE_INFO_INTERNAL_AUTO__UUID(Tag, A) AZ::Internal::GetTypeId< A , Tag >()
-#define AZ_TYPE_INFO_INTERNAL_AUTO__NAME(A) AZ::Internal::AzTypeInfoSafeCat(AZStd::data(typeName), AZStd::size(typeName), AZ::Internal::GetTypeName< A >())
+#define AZ_TYPE_INFO_INTERNAL_AUTO__NAME(A) AZ::Internal::GetTypeName< A >()
 
 #define AZ_TYPE_INFO_INTERNAL_EXPAND_I(NAME, TARGET)     NAME##__##TARGET
 #define AZ_TYPE_INFO_INTERNAL_EXPAND(NAME, TARGET)       AZ_TYPE_INFO_INTERNAL_EXPAND_I(NAME, TARGET)
@@ -953,11 +954,11 @@ namespace AZ
 #define AZ_TYPE_INFO_INTERNAL_TEMPLATE_ARGUMENT_EXPANSION_5(_1, _2, _3, _4, _5) AZ_TYPE_INFO_INTERNAL_TEMPLATE_ARGUMENT_EXPANSION_4(_1, _2, _3, _4), AZ_TYPE_INFO_INTERNAL_EXPAND(_5, ARG)(T5)
 #define AZ_TYPE_INFO_INTERNAL_TEMPLATE_ARGUMENT_EXPANSION(...) AZ_MACRO_SPECIALIZE(AZ_TYPE_INFO_INTERNAL_TEMPLATE_ARGUMENT_EXPANSION_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__))
 
-#define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_1(_1)                                                                                                                                                          AZ_TYPE_INFO_INTERNAL_EXPAND(_1, NAME)(T1);
-#define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_2(_1, _2)             AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_1(_1)             AZ::Internal::AzTypeInfoSafeCat(AZStd::data(typeName), AZStd::size(typeName), ", "); AZ_TYPE_INFO_INTERNAL_EXPAND(_2, NAME)(T2);
-#define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_3(_1, _2, _3)         AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_2(_1, _2)         AZ::Internal::AzTypeInfoSafeCat(AZStd::data(typeName), AZStd::size(typeName), ", "); AZ_TYPE_INFO_INTERNAL_EXPAND(_3, NAME)(T3);
-#define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_4(_1, _2, _3, _4)     AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_3(_1, _2, _3)     AZ::Internal::AzTypeInfoSafeCat(AZStd::data(typeName), AZStd::size(typeName), ", "); AZ_TYPE_INFO_INTERNAL_EXPAND(_4, NAME)(T4);
-#define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_5(_1, _2, _3, _4, _5) AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_4(_1, _2, _3, _4) AZ::Internal::AzTypeInfoSafeCat(AZStd::data(typeName), AZStd::size(typeName), ", "); AZ_TYPE_INFO_INTERNAL_EXPAND(_5, NAME)(T5);
+#define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_1(_1)                                                                                  AZ_TYPE_INFO_INTERNAL_EXPAND(_1, NAME)(T1)
+#define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_2(_1, _2)             AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_1(_1),             AZ_TYPE_INFO_INTERNAL_EXPAND(_2, NAME)(T2)
+#define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_3(_1, _2, _3)         AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_2(_1, _2),         AZ_TYPE_INFO_INTERNAL_EXPAND(_3, NAME)(T3)
+#define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_4(_1, _2, _3, _4)     AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_3(_1, _2, _3),     AZ_TYPE_INFO_INTERNAL_EXPAND(_4, NAME)(T4)
+#define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_5(_1, _2, _3, _4, _5) AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_4(_1, _2, _3, _4), AZ_TYPE_INFO_INTERNAL_EXPAND(_5, NAME)(T5)
 #define AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION(...) AZ_MACRO_SPECIALIZE(AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__))
 
 #define AZ_TYPE_INFO_INTERNAL_TEMPLATE_UUID_EXPANSION_1(Tag, _1)                                                                                         AZ_TYPE_INFO_INTERNAL_EXPAND(_1, UUID)(Tag, T1)
@@ -978,22 +979,20 @@ namespace AZ
             {                                                                                                       \
                 constexpr auto combineTypeNameBuffer = []() constexpr                                               \
                 {                                                                                                   \
-                    using CombineBufferType = AZStd::array<char, 1024>;                                             \
-                    CombineBufferType typeName{};                                                                   \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), _Name "<");                   \
-                    AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION(__VA_ARGS__)                                      \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), ">");                         \
+                    using CombineBufferType = AZStd::fixed_string<1024>;                                            \
+                    CombineBufferType typeName{ _Name "<" };                                                        \
+                    typeName.append_range(AZStd::to_array<AZStd::string_view>(                                      \
+                        { AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION(__VA_ARGS__) })                             \
+                        | AZStd::views::join_with(AZ::Internal::TypeNameSeparator));                                \
+                    typeName += '>';                                                                                \
                     return typeName;                                                                                \
                 }();                                                                                                \
-                /* Create a buffer that can store the exact number of characters for the type name + NUL */         \
-                constexpr size_t NameLength = AZStd::char_traits<char>::length(combineTypeNameBuffer.data());       \
-                AZStd::array<char, NameLength + 1> resultBuffer{};                                                  \
-                AZStd::copy(combineTypeNameBuffer.begin(), combineTypeNameBuffer.begin() + NameLength, resultBuffer.begin()); \
-                return resultBuffer;                                                                                \
+                /* Round up to power of 2 to reduce the number of fixed_string template instantiations */           \
+                return AZStd::fixed_string<AZ::AlignUpToPowerOfTwo(combineTypeNameBuffer.size())>(combineTypeNameBuffer); \
             }();                                                                                                    \
             constexpr const char* operator()() const                                                                \
             {                                                                                                       \
-                return TypeName.data();                                                                             \
+                return TypeName.c_str();                                                                            \
             }                                                                                                       \
         };                                                                                                          \
     public:                                                                                                         \
@@ -1002,29 +1001,29 @@ namespace AZ
             return TypeNameInternal{}();                                                                            \
         }                                                                                                           \
     private:                                                                                                        \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::CanonicalTypeIdTag)                                \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::CanonicalTypeIdTag)                             \
         {                                                                                                           \
-            static AZ::Internal::TypeIdHolder s_uuid(                                                               \
+            return AZ::TypeId(                                                                                      \
                 AZ::TypeId(_ClassUuid) +                                                                            \
                 AZ_TYPE_INFO_INTERNAL_TEMPLATE_UUID_EXPANSION(AZ::TypeIdResolverTags::CanonicalTypeIdTag, __VA_ARGS__)); \
-            return s_uuid;                                                                                          \
         }                                                                                                           \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::PointerRemovedTypeIdTag)                           \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::PointerRemovedTypeIdTag)                        \
         {                                                                                                           \
-            static AZ::Internal::TypeIdHolder s_uuid(                                                               \
+            return AZ::TypeId(                                                                                      \
                 AZ::TypeId(_ClassUuid) +                                                                            \
                 AZ_TYPE_INFO_INTERNAL_TEMPLATE_UUID_EXPANSION(AZ::TypeIdResolverTags::PointerRemovedTypeIdTag, __VA_ARGS__)); \
-            return s_uuid;                                                                                          \
         }                                                                                                           \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::GenericTypeIdTag)                                  \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::GenericTypeIdTag)                               \
         {                                                                                                           \
             return AzGenericTypeInfo::Uuid<_Specialization>();                                                      \
         }                                                                                                           \
+        template<class TypeIdResolverTag>                                                                           \
+        inline static constexpr AZ::TypeId s_uuid_v = UuidTag(TypeIdResolverTag{});                                 \
     public:                                                                                                         \
         template<typename Tag = AZ::TypeIdResolverTags::CanonicalTypeIdTag>                                         \
-        static const AZ::TypeId& Uuid()                                                                             \
+        static constexpr AZ::TypeId Uuid()                                                                          \
         {                                                                                                           \
-            return UuidTag(Tag{});                                                                                  \
+            return s_uuid_v<Tag>;                                                                                   \
         }                                                                                                           \
         static constexpr TypeTraits GetTypeTraits()                                                                 \
         {                                                                                                           \
@@ -1051,22 +1050,20 @@ namespace AZ
             {                                                                                                       \
                 constexpr auto combineTypeNameBuffer = []() constexpr                                               \
                 {                                                                                                   \
-                    using CombineBufferType = AZStd::array<char, 1024>;                                             \
-                    CombineBufferType typeName{};                                                                   \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), #_Specialization "<");        \
-                    AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION(__VA_ARGS__)                                      \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), ">");                         \
+                    using CombineBufferType = AZStd::fixed_string<1024>;                                            \
+                    CombineBufferType typeName{ #_Specialization "<" };                                             \
+                    typeName.append_range(AZStd::to_array<AZStd::string_view>(                                      \
+                        { AZ_TYPE_INFO_INTERNAL_TEMPLATE_NAME_EXPANSION(__VA_ARGS__) })                             \
+                        | AZStd::views::join_with(AZ::Internal::TypeNameSeparator));                                \
+                    typeName += '>';                                                                                \
                     return typeName;                                                                                \
                 }();                                                                                                \
-                /* Create a buffer that can store the exact number of characters for the type name + NUL */         \
-                constexpr size_t NameLength = AZStd::char_traits<char>::length(combineTypeNameBuffer.data());       \
-                AZStd::array<char, NameLength + 1> resultBuffer{};                                                  \
-                AZStd::copy(combineTypeNameBuffer.begin(), combineTypeNameBuffer.begin() + NameLength, resultBuffer.begin()); \
-                return resultBuffer;                                                                                \
+                /* Round up to power of 2 to reduce the number of fixed_string template instantiations */           \
+                return AZStd::fixed_string<AZ::AlignUpToPowerOfTwo(combineTypeNameBuffer.size())>(combineTypeNameBuffer); \
             }();                                                                                                    \
             constexpr const char* operator()() const                                                                \
             {                                                                                                       \
-                return TypeName.data();                                                                             \
+                return TypeName.c_str();                                                                            \
             }                                                                                                       \
         };                                                                                                          \
     public:                                                                                                         \
@@ -1075,29 +1072,29 @@ namespace AZ
             return TypeNameInternal{}();                                                                            \
         }                                                                                                           \
     private:                                                                                                        \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::CanonicalTypeIdTag)                                \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::CanonicalTypeIdTag)                             \
         {                                                                                                           \
-            static AZ::Internal::TypeIdHolder s_uuid(                                                               \
+            return AZ::TypeId(                                                                                      \
                 AZ_TYPE_INFO_INTERNAL_TEMPLATE_UUID_EXPANSION(AZ::TypeIdResolverTags::CanonicalTypeIdTag, __VA_ARGS__) \
                 + AZ::TypeId(_ClassUuid));                                                                          \
-            return s_uuid;                                                                                          \
         }                                                                                                           \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::PointerRemovedTypeIdTag)                           \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::PointerRemovedTypeIdTag)                        \
         {                                                                                                           \
-            static AZ::Internal::TypeIdHolder s_uuid(                                                               \
+            return AZ::TypeId(                                                                                      \
                 AZ_TYPE_INFO_INTERNAL_TEMPLATE_UUID_EXPANSION(AZ::TypeIdResolverTags::PointerRemovedTypeIdTag, __VA_ARGS__) \
                 + AZ::TypeId(_ClassUuid));                                                                          \
-            return s_uuid;                                                                                          \
         }                                                                                                           \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::GenericTypeIdTag)                                  \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::GenericTypeIdTag)                               \
         {                                                                                                           \
             return AzGenericTypeInfo::Uuid<_Specialization>();                                                      \
         }                                                                                                           \
+        template<class TypeIdResolverTag>                                                                           \
+        inline static constexpr AZ::TypeId s_uuid_v = UuidTag(TypeIdResolverTag{});                                 \
     public:                                                                                                         \
         template<typename Tag = AZ::TypeIdResolverTags::CanonicalTypeIdTag>                                         \
-        static const AZ::TypeId& Uuid()                                                                             \
+        static constexpr AZ::TypeId Uuid()                                                                          \
         {                                                                                                           \
-            return UuidTag(Tag{});                                                                                  \
+            return s_uuid_v<Tag>;                                                                                   \
         }                                                                                                           \
         static constexpr TypeTraits GetTypeTraits()                                                                 \
         {                                                                                                           \
@@ -1110,7 +1107,7 @@ namespace AZ
         {                                                                                                           \
             return sizeof(_Specialization<AZ_TYPE_INFO_INTERNAL_TEMPLATE_ARGUMENT_EXPANSION(__VA_ARGS__)>);         \
         }                                                                                                           \
-        static bool Specialized() { return true; }                                                                  \
+        static constexpr bool Specialized() { return true; }                                                        \
     }
 
 #define AZ_TYPE_INFO_INTERNAL_FUNCTION_VARIATION_SPECIALIZATION(_Specialization, _ClassUuid)\
@@ -1124,23 +1121,19 @@ namespace AZ
             {                                                                                                       \
                 constexpr auto combineTypeNameBuffer = []() constexpr                                               \
                 {                                                                                                   \
-                    using CombineBufferType = AZStd::array<char, 1024>;                                             \
-                    CombineBufferType typeName{};                                                                   \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), #_Specialization "<");        \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), AZ::AzTypeInfo<R>::Name());   \
-                    AZ::Internal::AggregateTypes<Args...>::TypeName(typeName.data(), typeName.size());              \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), ">");                         \
+                    using CombineBufferType = AZStd::fixed_string<1024>;                                            \
+                    CombineBufferType typeName{ #_Specialization "<" };                                             \
+                    typeName += AZ::AzTypeInfo<R>::Name();                                                          \
+                    typeName += AZ::Internal::AggregateTypes<Args...>::TypeName();                                  \
+                    typeName += '>';                                                                                \
                     return typeName;                                                                                \
                 }();                                                                                                \
-                /* Create a buffer that can store the exact number of characters for the type name + NUL */         \
-                constexpr size_t NameLength = AZStd::char_traits<char>::length(combineTypeNameBuffer.data());       \
-                AZStd::array<char, NameLength + 1> resultBuffer{};                                                  \
-                AZStd::copy(combineTypeNameBuffer.begin(), combineTypeNameBuffer.begin() + NameLength, resultBuffer.begin()); \
-                return resultBuffer;                                                                                \
+                /* Round up to power of 2 to reduce the number of fixed_string template instantiations */           \
+                return AZStd::fixed_string<AZ::AlignUpToPowerOfTwo(combineTypeNameBuffer.size())>(combineTypeNameBuffer); \
             }();                                                                                                    \
             constexpr const char* operator()() const                                                                \
             {                                                                                                       \
-                return TypeName.data();                                                                             \
+                return TypeName.c_str();                                                                            \
             }                                                                                                       \
         };                                                                                                          \
     public:                                                                                                         \
@@ -1149,29 +1142,29 @@ namespace AZ
             return TypeNameInternal{}();                                                                            \
         }                                                                                                           \
     private: \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::CanonicalTypeIdTag) \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::CanonicalTypeIdTag) \
         { \
-            static AZ::Internal::TypeIdHolder s_uuid( \
+            return AZ::TypeId( \
                 AZ::Uuid(_ClassUuid) + AZ::AzTypeInfo<R>::template Uuid<AZ::TypeIdResolverTags::CanonicalTypeIdTag>() + \
                 AZ::Internal::AggregateTypes<Args...>::template Uuid<AZ::TypeIdResolverTags::CanonicalTypeIdTag>()); \
-            return s_uuid; \
         } \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::PointerRemovedTypeIdTag) \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::PointerRemovedTypeIdTag) \
         { \
-            static AZ::Internal::TypeIdHolder s_uuid( \
+            return AZ::TypeId( \
                 AZ::Uuid(_ClassUuid) + AZ::AzTypeInfo<R>::template Uuid<AZ::TypeIdResolverTags::PointerRemovedTypeIdTag>() + \
                 AZ::Internal::AggregateTypes<Args...>::template Uuid<AZ::TypeIdResolverTags::PointerRemovedTypeIdTag>()); \
-            return s_uuid; \
         } \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::GenericTypeIdTag) \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::GenericTypeIdTag) \
         { \
             return AzGenericTypeInfo::Uuid<_Specialization>(); \
         } \
+        template<class TypeIdResolverTag> \
+        inline static constexpr AZ::TypeId s_uuid_v = UuidTag(TypeIdResolverTag{}); \
     public: \
         template<typename Tag = AZ::TypeIdResolverTags::CanonicalTypeIdTag> \
-        static const AZ::TypeId& Uuid() \
+        static constexpr AZ::TypeId Uuid() \
         { \
-            return UuidTag(Tag{}); \
+            return s_uuid_v<Tag>; \
         } \
         static constexpr TypeTraits GetTypeTraits() \
         { \
@@ -1184,7 +1177,7 @@ namespace AZ
         { \
             return sizeof(_Specialization<R(Args...)>); \
         } \
-        static bool Specialized() { return true; } \
+        static constexpr bool Specialized() { return true; } \
     }
 
     /* This version of AZ_TYPE_INFO_INTERNAL_VARIATION_SPECIALIZATION_2 only uses the first argument for UUID generation purposes */
@@ -1199,22 +1192,18 @@ namespace AZ
             {                                                                                                        \
                 constexpr auto combineTypeNameBuffer = []() constexpr                                                \
                 {                                                                                                    \
-                    using CombineBufferType = AZStd::array<char, 1024>;                                              \
-                    CombineBufferType typeName{};                                                                    \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), #_Specialization "<");         \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), AZ::AzTypeInfo<_T1>::Name());  \
-                    AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), ">");                          \
+                    using CombineBufferType = AZStd::fixed_string<1024>;                                             \
+                    CombineBufferType typeName{ #_Specialization "<" };                                              \
+                    typeName += AZ::AzTypeInfo<_T1>::Name();                                                         \
+                    typeName += '>';                                                                                 \
                     return typeName;                                                                                 \
                 }();                                                                                                 \
-                /* Create a buffer that can store the exact number of characters for the type name + NUL */          \
-                constexpr size_t NameLength = AZStd::char_traits<char>::length(combineTypeNameBuffer.data());        \
-                AZStd::array<char, NameLength + 1> resultBuffer{};                                                   \
-                AZStd::copy(combineTypeNameBuffer.begin(), combineTypeNameBuffer.begin() + NameLength, resultBuffer.begin()); \
-                return resultBuffer;                                                                                 \
+                /* Round up to power of 2 to reduce the number of fixed_string template instantiations */            \
+                return AZStd::fixed_string<AZ::AlignUpToPowerOfTwo(combineTypeNameBuffer.size())>(combineTypeNameBuffer);\
             }();                                                                                                     \
             constexpr const char* operator()() const                                                                 \
             {                                                                                                        \
-                return TypeName.data();                                                                              \
+                return TypeName.c_str();                                                                             \
             }                                                                                                        \
         };                                                                                                           \
     public:                                                                                                          \
@@ -1223,29 +1212,29 @@ namespace AZ
             return TypeNameInternal{}();                                                                             \
         }                                                                                                            \
     private:                                                                                                         \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::CanonicalTypeIdTag)                                 \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::CanonicalTypeIdTag)                              \
         {                                                                                                            \
-            static AZ::Internal::TypeIdHolder s_uuid(                                                                \
-                AZ::AzTypeInfo<_T1>::template Uuid<AZ::TypeIdResolverTags::CanonicalTypeIdTag>() +                   \
+            return AZ::TypeId(                                                                                       \
+                AZ::AzTypeInfo<_T1>::template Uuid<AZ::TypeIdResolverTags::PointerRemovedTypeIdTag>() +              \
                 AZ::TypeId(_AddUuid));                                                                               \
-            return s_uuid;                                                                                           \
         }                                                                                                            \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::PointerRemovedTypeIdTag)                            \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::PointerRemovedTypeIdTag)                         \
         {                                                                                                            \
-            static AZ::Internal::TypeIdHolder s_uuid(                                                                \
+            return AZ::TypeId(                                                                                       \
                 AZ::AzTypeInfo<_T1>::template Uuid<AZ::TypeIdResolverTags::PointerRemovedTypeIdTag>() +              \
                 AZ::TypeId(_AddUuid));                                                                               \
-            return s_uuid;                                                                                           \
         }                                                                                                            \
-        static const AZ::TypeId& UuidTag(AZ::TypeIdResolverTags::GenericTypeIdTag)                                   \
+        static constexpr AZ::TypeId UuidTag(AZ::TypeIdResolverTags::GenericTypeIdTag)                                \
         {                                                                                                            \
             return AzGenericTypeInfo::Uuid<_Specialization>();                                                       \
         }                                                                                                            \
+        template<class TypeIdResolverTag>                                                                            \
+        inline static constexpr AZ::TypeId s_uuid_v = UuidTag(TypeIdResolverTag{});                                  \
     public:                                                                                                          \
         template<typename Tag = AZ::TypeIdResolverTags::CanonicalTypeIdTag>                                          \
-        static const AZ::TypeId& Uuid()                                                                              \
+        static constexpr AZ::TypeId Uuid()                                                                           \
         {                                                                                                            \
-            return UuidTag(Tag{});                                                                                   \
+            return s_uuid_v<Tag>;                                                                                    \
         }                                                                                                            \
         static constexpr TypeTraits GetTypeTraits()                                                                  \
         {                                                                                                            \
@@ -1258,7 +1247,7 @@ namespace AZ
         {                                                                                                            \
             return sizeof(_Specialization<_T1, _T2>);                                                                \
         }                                                                                                            \
-        static bool Specialized() { return true; }                                                                   \
+        static constexpr bool Specialized() { return true; }                                                         \
     }
 
     AZ_TYPE_INFO_INTERNAL_SPECIALIZE(char, "{3AB0037F-AF8D-48ce-BCA0-A170D18B2C03}");
@@ -1331,39 +1320,34 @@ namespace AZ
 } // namespace AZ
 
 // Template class type info
-#define AZ_TYPE_INFO_INTERNAL_TEMPLATE(_ClassName, _ClassUuid, ...)\
-    struct TYPEINFO_Enable{};\
-    struct TypeNameInternal\
-    {\
+#define AZ_TYPE_INFO_INTERNAL_TEMPLATE(_ClassName, _ClassUuid, ...) \
+    struct TYPEINFO_Enable{}; \
+    struct TypeNameInternal \
+    { \
         static constexpr auto TypeName = []() constexpr \
-        {\
+        { \
             constexpr auto combineTypeNameBuffer = []() constexpr \
-            {\
-                using CombineBufferType = AZStd::array<char, 1024>;\
-                CombineBufferType typeName{};\
-                AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), #_ClassName "<");\
-                AZ::Internal::AggregateTypes<__VA_ARGS__>::TypeName(typeName.data(), typeName.size());\
-                AZ::Internal::AzTypeInfoSafeCat(typeName.data(), typeName.size(), ">");\
-                return typeName;\
-            }();\
-            /* Create a buffer that can store the exact number of characters for the type name + NUL */ \
-            constexpr size_t NameLength = AZStd::char_traits<char>::length(combineTypeNameBuffer.data());\
-            AZStd::array<char, NameLength + 1> resultBuffer{};\
-            AZStd::copy(combineTypeNameBuffer.begin(), combineTypeNameBuffer.begin() + NameLength, resultBuffer.begin());\
-            return resultBuffer;\
-        }();\
+            { \
+                using CombineBufferType = AZStd::fixed_string<1024>; \
+                CombineBufferType typeName{ #_ClassName "<" }; \
+                typeName += AZ::Internal::AggregateTypes<__VA_ARGS__>::TypeName(); \
+                typeName += '>'; \
+                return typeName; \
+            }(); \
+            return AZStd::fixed_string<AZ::AlignUpToPowerOfTwo(combineTypeNameBuffer.size())>(combineTypeNameBuffer); \
+        }(); \
         constexpr const char* operator()() const \
         { \
-            return TypeName.data(); \
+            return TypeName.c_str(); \
         } \
     }; \
     static constexpr const char* TYPEINFO_Name() \
     { \
         return TypeNameInternal{}(); \
     } \
-    static const AZ::TypeId& TYPEINFO_Uuid() {\
-        static AZ::Internal::TypeIdHolder s_uuid(AZ::TypeId(_ClassUuid) + AZ::Internal::AggregateTypes<__VA_ARGS__>::Uuid());\
-        return s_uuid;\
+    static constexpr AZ::TypeId TYPEINFO_Uuid() \
+    { \
+        return AZ::TypeId(_ClassUuid) + AZ::Internal::AggregateTypes<__VA_ARGS__>::Uuid(); \
     }
 
 // Template class type info

+ 1 - 1
Code/Framework/AzCore/AzCore/RTTI/TypeInfoSimple.h

@@ -20,7 +20,7 @@ namespace AZ
     struct TYPEINFO_Enable{}; \
     struct TypeNameInternal { constexpr const char* operator()() const { return #_ClassName; } }; \
     static constexpr const char* TYPEINFO_Name() { return TypeNameInternal{}(); } \
-    static const AZ::TypeId& TYPEINFO_Uuid() { static AZ::TypeId s_uuid(_ClassUuid); return s_uuid; }
+    static constexpr AZ::TypeId TYPEINFO_Uuid() { return AZ::TypeId(_ClassUuid); }
 
 #define AZ_TYPE_INFO_1 AZ_TYPE_INFO_INTERNAL_1
 #define AZ_TYPE_INFO_2 AZ_TYPE_INFO_INTERNAL_2

+ 1 - 1
Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp

@@ -546,7 +546,7 @@ namespace AZ
         //////////////////////////////////////////////////////////////////////////
         void* LuaScriptValueStackRead(lua_State* lua, int stackIndex, const AZ::Uuid typeId)
         {
-            if (typeId == nullptr || lua_islightuserdata(lua, stackIndex))
+            if (typeId.IsNull() || lua_islightuserdata(lua, stackIndex))
             {
                 return lua_touserdata(lua, stackIndex);
             }

+ 2 - 1
Code/Framework/AzCore/AzCore/Script/ScriptContext.h

@@ -633,7 +633,8 @@ namespace AZ
     template<class T>
     inline bool ScriptDataContext::IsClass(int index) const
     {
-        return AZ::Internal::LuaIsClass(m_nativeContext, m_startVariableIndex + index, &AzTypeInfo<T>::Uuid());
+        constexpr auto uuidValue{ AzTypeInfo<T>::Uuid() };
+        return AZ::Internal::LuaIsClass(m_nativeContext, m_startVariableIndex + index, &uuidValue);
     }
     template<class T>
     inline bool ScriptDataContext::ReadArg(int index, T& valueRef) const

+ 9 - 9
Code/Framework/AzCore/AzCore/Script/ScriptProperty.cpp

@@ -183,7 +183,7 @@ namespace AZ
         return nullptr;
     }
 
-    const AZ::Uuid& ScriptPropertyNil::GetDataTypeUuid() const
+    AZ::TypeId ScriptPropertyNil::GetDataTypeUuid() const
     {
         return AZ::SerializeTypeInfo<void*>::GetUuid();
     }
@@ -271,7 +271,7 @@ namespace AZ
         return false;
     }
 
-    const AZ::Uuid& ScriptPropertyBoolean::GetDataTypeUuid() const
+    AZ::TypeId ScriptPropertyBoolean::GetDataTypeUuid() const
     {
         return AZ::SerializeTypeInfo<bool>::GetUuid();
     }
@@ -345,7 +345,7 @@ namespace AZ
         return false;
     }
 
-    const AZ::Uuid& ScriptPropertyNumber::GetDataTypeUuid() const
+    AZ::TypeId ScriptPropertyNumber::GetDataTypeUuid() const
     {
         return AZ::SerializeTypeInfo<double>::GetUuid();
     }
@@ -425,7 +425,7 @@ namespace AZ
         return readValue;
     }
 
-    const AZ::Uuid& ScriptPropertyString::GetDataTypeUuid() const
+    AZ::TypeId ScriptPropertyString::GetDataTypeUuid() const
     {
         return AZ::SerializeGenericTypeInfo<AZStd::string>::GetClassTypeId();
     }
@@ -789,7 +789,7 @@ namespace AZ
         }
     }
 
-    const AZ::Uuid& ScriptPropertyBooleanArray::GetDataTypeUuid() const
+    AZ::TypeId ScriptPropertyBooleanArray::GetDataTypeUuid() const
     {
         return AZ::SerializeGenericTypeInfo< AZStd::vector<bool> >::GetClassTypeId();
     }
@@ -915,7 +915,7 @@ namespace AZ
         }
     }
 
-    const AZ::Uuid& ScriptPropertyNumberArray::GetDataTypeUuid() const
+    AZ::TypeId ScriptPropertyNumberArray::GetDataTypeUuid() const
     {
         return AZ::SerializeGenericTypeInfo< AZStd::vector<double> >::GetClassTypeId();
     }
@@ -1041,7 +1041,7 @@ namespace AZ
         }
     }
 
-    const AZ::Uuid& ScriptPropertyStringArray::GetDataTypeUuid() const
+    AZ::TypeId ScriptPropertyStringArray::GetDataTypeUuid() const
     {
         return AZ::SerializeGenericTypeInfo< AZStd::vector<AZStd::string> >::GetClassTypeId();
     }
@@ -1199,7 +1199,7 @@ namespace AZ
         }
     }
 
-    const AZ::Uuid& ScriptPropertyGenericClassArray::GetDataTypeUuid() const
+    AZ::TypeId ScriptPropertyGenericClassArray::GetDataTypeUuid() const
     {
         return AZ::SerializeGenericTypeInfo< ValueArrayType >::GetClassTypeId();
     }
@@ -1324,7 +1324,7 @@ namespace AZ
         }
     }
 
-    const AZ::Uuid& ScriptPropertyAsset::GetDataTypeUuid() const
+    AZ::TypeId ScriptPropertyAsset::GetDataTypeUuid() const
     {
         return AZ::SerializeTypeInfo<AZ::Data::Asset<AZ::Data::AssetData> >::GetUuid();
     }

+ 11 - 11
Code/Framework/AzCore/AzCore/Script/ScriptProperty.h

@@ -62,7 +62,7 @@ namespace AZ
             , m_name(name) {}
 
         virtual const void* GetDataAddress() const = 0;
-        virtual const AZ::Uuid& GetDataTypeUuid() const = 0;
+        virtual AZ::TypeId GetDataTypeUuid() const = 0;
 
         /**
          * Test if the value at the index valueIndex is of the same type as that of the instance of ScriptProperty's subclass.
@@ -137,7 +137,7 @@ namespace AZ
         ScriptPropertyNil(const char* name) : ScriptProperty(name) {}
 
         const void* GetDataAddress() const override;
-        const AZ::Uuid& GetDataTypeUuid() const override;
+        AZ::TypeId GetDataTypeUuid() const override;
 
         ScriptPropertyNil* Clone(const char* name) const override;
 
@@ -165,7 +165,7 @@ namespace AZ
             , m_value(value) {}
 
         const void* GetDataAddress() const override { return &m_value; }
-        const AZ::Uuid& GetDataTypeUuid() const override;
+        AZ::TypeId GetDataTypeUuid() const override;
 
         bool DoesTypeMatch(AZ::ScriptDataContext& context, int valueIndex) const override;
 
@@ -197,7 +197,7 @@ namespace AZ
             , m_value(value)  {}
 
         const void* GetDataAddress() const override { return &m_value; }
-        const AZ::Uuid& GetDataTypeUuid() const override;
+        AZ::TypeId GetDataTypeUuid() const override;
 
         bool DoesTypeMatch(AZ::ScriptDataContext& context, int valueIndex) const override;
 
@@ -228,7 +228,7 @@ namespace AZ
             , m_value(value) {}
 
         const void* GetDataAddress() const override { return &m_value; }
-        const AZ::Uuid& GetDataTypeUuid() const override;
+        AZ::TypeId GetDataTypeUuid() const override;
 
         bool DoesTypeMatch(AZ::ScriptDataContext& context, int valueIndex)  const override;
 
@@ -262,7 +262,7 @@ namespace AZ
         ~ScriptPropertyGenericClass() override;
 
         const void* GetDataAddress() const override { return m_value.m_data; }
-        const AZ::Uuid& GetDataTypeUuid() const override { return m_value.m_typeId; }
+        AZ::TypeId GetDataTypeUuid() const override { return m_value.m_typeId; }
 
         bool DoesTypeMatch(AZ::ScriptDataContext& context, int valueIndex) const override;
 
@@ -334,7 +334,7 @@ namespace AZ
             : ScriptProperty(name)      {}
 
         const void* GetDataAddress() const override { return &m_values; }
-        const AZ::Uuid& GetDataTypeUuid() const override;
+        AZ::TypeId GetDataTypeUuid() const override;
 
         bool DoesTypeMatch(AZ::ScriptDataContext& context, int valueIndex) const override;
 
@@ -365,7 +365,7 @@ namespace AZ
             : ScriptProperty(name)         {}
 
         const void* GetDataAddress() const override { return &m_values; }
-        const AZ::Uuid& GetDataTypeUuid() const override;
+        AZ::TypeId GetDataTypeUuid() const override;
 
         bool DoesTypeMatch(AZ::ScriptDataContext& context, int valueIndex) const override;
 
@@ -396,7 +396,7 @@ namespace AZ
             : ScriptProperty(name)      {}
 
         const void* GetDataAddress() const override { return &m_values; }
-        const AZ::Uuid& GetDataTypeUuid() const override;
+        AZ::TypeId GetDataTypeUuid() const override;
 
         bool DoesTypeMatch(AZ::ScriptDataContext& context, int valueIndex) const override;
 
@@ -435,7 +435,7 @@ namespace AZ
             }
         }
         const void* GetDataAddress() const override { return &m_values; }
-        const AZ::Uuid& GetDataTypeUuid() const override;
+        AZ::TypeId GetDataTypeUuid() const override;
         AZ::Uuid GetElementTypeUuid() const;
 
         void SetElementTypeUuid(const AZ::Uuid);
@@ -474,7 +474,7 @@ namespace AZ
         virtual ~ScriptPropertyAsset() = default;
 
         const void* GetDataAddress() const override { return &m_value; }
-        const AZ::Uuid& GetDataTypeUuid() const override;
+        AZ::TypeId GetDataTypeUuid() const override;
 
         bool DoesTypeMatch(AZ::ScriptDataContext& context, int valueIndex) const override;
 

+ 33 - 33
Code/Framework/AzCore/AzCore/Script/ScriptPropertyTable.h

@@ -35,10 +35,10 @@ namespace AZ
     public:
         struct MapValuePair
         {
-            MapValuePair()                    
+            MapValuePair()
                 : m_keyProperty(nullptr)
                 , m_valueProperty(nullptr)
-            {                
+            {
             }
 
             void CloneTo(MapValuePair& targetProperty)
@@ -56,19 +56,19 @@ namespace AZ
 
                 delete m_valueProperty;
                 m_valueProperty = nullptr;
-            }            
+            }
 
             AZ::ScriptPropertyGenericClass* m_keyProperty;
             AZ::ScriptProperty*             m_valueProperty;
         };
-        
-        AZ_CLASS_ALLOCATOR(ScriptPropertyGenericClassMap, SystemAllocator, 0);            
+
+        AZ_CLASS_ALLOCATOR(ScriptPropertyGenericClassMap, SystemAllocator, 0);
 
         ScriptPropertyGenericClassMap() = default;
         virtual ~ScriptPropertyGenericClassMap() = default;
 
         virtual void UpdateTableValue(const AZ::ScriptPropertyGenericClass* keyProperty, AZ::ScriptDataContext& scriptDataContext, int valueIndex) = 0;
-        virtual void SetTableValue(const AZ::ScriptPropertyGenericClass* keyProperty, const AZ::ScriptProperty* scriptProperty) = 0;            
+        virtual void SetTableValue(const AZ::ScriptPropertyGenericClass* keyProperty, const AZ::ScriptProperty* scriptProperty) = 0;
         virtual AZ::ScriptProperty* FindTableValue(const AZ::ScriptPropertyGenericClass* keyProperty) const = 0;
 
         virtual void SetWatcher(AZ::ScriptPropertyWatcher* scriptPropertyWatcher) = 0;
@@ -89,7 +89,7 @@ namespace AZ
         ScriptPropertyGenericClassMapImpl()
             : m_scriptPropertyWatcher(nullptr)
             , m_keyTypeId(T::TYPEINFO_Uuid())
-        {                
+        {
         }
 
         ~ScriptPropertyGenericClassMapImpl() override
@@ -107,7 +107,7 @@ namespace AZ
             if (keyProperty->GetDataTypeUuid() == m_keyTypeId)
             {
                 const T* dataSource = keyProperty->Get<T>();
-                    
+
                 auto valueIter = m_pairMapping.find((*dataSource));
 
                 if (valueIter == m_pairMapping.end())
@@ -120,7 +120,7 @@ namespace AZ
                     WatchValueProperty(valuePair.m_valueProperty);
 
                     m_pairMapping.emplace((*dataSource),valuePair);
-                    
+
                 }
                 else
                 {
@@ -151,7 +151,7 @@ namespace AZ
         void SetTableValue(const AZ::ScriptPropertyGenericClass* keyProperty, const AZ::ScriptProperty* scriptProperty) override
         {
             AZ_Assert(keyProperty->GetDataTypeUuid() == m_keyTypeId, "Passing wrong GenericClass Type to ScriptPropertyMap implementation");
-                
+
             if (keyProperty->GetDataTypeUuid() == m_keyTypeId)
             {
                 const T* dataSource = keyProperty->Get<T>();
@@ -180,7 +180,7 @@ namespace AZ
 
                         if (scriptProperty != nullptr && !azrtti_istypeof<AZ::ScriptPropertyNil>(scriptProperty))
                         {
-                            valueIter->second.m_valueProperty = scriptProperty->Clone();                            
+                            valueIter->second.m_valueProperty = scriptProperty->Clone();
 
                             WatchValueProperty(valueIter->second.m_valueProperty);
                         }
@@ -202,7 +202,7 @@ namespace AZ
             if (keyProperty->GetDataTypeUuid() == m_keyTypeId)
             {
                 const T* dataSource = keyProperty->Get<T>();
-                    
+
                 auto valueIter = m_pairMapping.find((*dataSource));
 
                 if (valueIter !=  m_pairMapping.end())
@@ -251,13 +251,13 @@ namespace AZ
                     m_pairMapping.emplace(sourcePair.first, newPair);
                 }
             }
-                
+
             auto mapIter = m_pairMapping.begin();
             while (mapIter != m_pairMapping.end())
-            {                    
+            {
                 if (newKeys.find(mapIter->first) == newKeys.end())
                 {
-                    mapIter->second.Destroy();                    
+                    mapIter->second.Destroy();
                     mapIter = m_pairMapping.erase(mapIter);
                 }
                 else
@@ -269,7 +269,7 @@ namespace AZ
 
         const AZStd::unordered_map<T, MapValuePair>& GetPairMapping() const
         {
-            return m_pairMapping;   
+            return m_pairMapping;
         }
 
         AZStd::unordered_map<T, MapValuePair>& GetPairMapping()
@@ -282,13 +282,13 @@ namespace AZ
             AZ_Error("ScriptPropertyTable", m_scriptPropertyWatcher == nullptr || scriptPropertyWatcher == nullptr, "Trying to add two script property watchers to a Generic Keyed Script Property Map");
             if (m_scriptPropertyWatcher == nullptr || scriptPropertyWatcher == nullptr)
             {
-                m_scriptPropertyWatcher = scriptPropertyWatcher;                
+                m_scriptPropertyWatcher = scriptPropertyWatcher;
 
                 for (auto& mapPair : m_pairMapping)
                 {
                     WatchValueProperty(mapPair.second.m_valueProperty);
                 }
-            }           
+            }
         }
 
     private:
@@ -323,19 +323,19 @@ namespace AZ
         , public ScriptPropertyWatcherBus::Handler
     {
     private:
-        friend class AzFramework::ScriptPropertyMarshaler;        
+        friend class AzFramework::ScriptPropertyMarshaler;
         friend class AzFramework::ScriptPropertyTableMarshalerHelper;
 
     public:
         typedef AZStd::unordered_map<int, ScriptProperty*> ScriptPropertyIndexMap;
-        typedef AZStd::unordered_map<AZ::Crc32, ScriptProperty*> ScriptPropertyKeyedMap;        
+        typedef AZStd::unordered_map<AZ::Crc32, ScriptProperty*> ScriptPropertyKeyedMap;
         typedef AZStd::unordered_map<AZ::Uuid, ScriptPropertyGenericClassMap* > ScriptPropertyGenericMap;
 
         AZ_CLASS_ALLOCATOR(ScriptPropertyTable, SystemAllocator, 0);
         AZ_RTTI(AZ::ScriptPropertyTable, "{0EB069C0-F6C6-4871-9BDB-CC1BBF0B5315}", FunctionalScriptProperty);
-        
+
         // No reflection for this one. Since we would need to reflect pointers.
-        static ScriptProperty* TryCreateProperty(ScriptDataContext& context, int valueIndex, const char* name);        
+        static ScriptProperty* TryCreateProperty(ScriptDataContext& context, int valueIndex, const char* name);
 
         ScriptPropertyTable();
         explicit ScriptPropertyTable(const char* name);
@@ -344,10 +344,10 @@ namespace AZ
         ~ScriptPropertyTable() override;
 
         ScriptProperty* FindTableValue(AZ::ScriptDataContext& scriptDataContext, int keyIndex) const;
-        ScriptProperty* FindTableValue(const AZ::ScriptPropertyGenericClass* scriptProperty) const;        
+        ScriptProperty* FindTableValue(const AZ::ScriptPropertyGenericClass* scriptProperty) const;
         ScriptProperty* FindTableValue(const AZStd::string_view& keyValue) const;
-        ScriptProperty* FindTableValue(int index) const;        
-        
+        ScriptProperty* FindTableValue(int index) const;
+
         // This is the generalized update method that will determine the correct type of key to use.
         void UpdateTableValue(AZ::ScriptDataContext& scriptDataContext, int keyIndex, int valueIndex);
 
@@ -355,7 +355,7 @@ namespace AZ
         void UpdateTableValue(const AZ::ScriptPropertyGenericClass* scriptProperty, AZ::ScriptDataContext& scriptDataContext, int index);
         void UpdateTableValue(const AZStd::string_view& keyValue, AZ::ScriptDataContext& scriptDataContext, int index);
         void UpdateTableValue(int tableIndex, AZ::ScriptDataContext& scriptDataContext, int stackIndex);
-        
+
         void SetTableValue(const AZ::ScriptProperty* keyProperty, const AZ::ScriptProperty* value);
         void SetTableValue(const AZ::ScriptPropertyGenericClass* keyProperty, const AZ::ScriptProperty* value);
         void SetTableValue(const AZStd::string_view& keyValue, const ScriptProperty* value);
@@ -380,8 +380,8 @@ namespace AZ
 
         // TODO: Investigate what is actually needed here.
         const void* GetDataAddress() const override { return nullptr; }
-        const Uuid& GetDataTypeUuid() const override 
-        { 
+        AZ::TypeId GetDataTypeUuid() const override
+        {
             static Uuid k_invalidUuid = Uuid();
             return k_invalidUuid;
         }
@@ -394,23 +394,23 @@ namespace AZ
         // If the Property is going to be re-used(and owned somewhere), MetatableControl should be enabled
         // which will push out a lightweight table, that contains metamethods
         // to simulate the correct output from the object.
-        bool Write(AZ::ScriptContext& context) override;                
+        bool Write(AZ::ScriptContext& context) override;
 
         // Bypasses the metatable indexing, and writes out the actual raw values of the table.
         bool WriteRawTable(AZ::ScriptContext& context);
-        
+
         void EnableInPlaceControls() override;
         void DisableInPlaceControls() override;
 
         AZ::ScriptContext* GetScriptContext() const;
-        
+
         // Doesn't return the actual size, but returns what lua defines as the length of the table.
         // http://www.lua.org/manual/5.2/manual.html#3.4.6
         //
         // tl;dr - Let the length of the table be N, where N is the the largest integer s.t. 1..N, are all keys present in the table.
         int GetLuaTableLength() const;
 
-        
+
         // ScriptPropertyWatcherBus
          void OnObjectModified() override;
 
@@ -451,7 +451,7 @@ namespace AZ
         bool                   m_enableMetatableControl;
         AZ::ScriptContext*     m_scriptContext;
         int                    m_tableCache;
-    
+
         ScriptPropertyIndexMap      m_indexMapping;
         ScriptPropertyKeyedMap      m_keyMapping;
         ScriptPropertyGenericMap    m_genericMapping;

+ 117 - 117
Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl

@@ -2136,7 +2136,7 @@ namespace AZ
 
     AZ_TYPE_INFO_INTERNAL_SPECIALIZED_TEMPLATE_POSTFIX_UUID(AZ::Internal::RValueToLValueWrapper, "{2590807F-5748-4CD0-A475-83EF5FD216CF}", AZ_TYPE_INFO_TYPENAME);
 
-    AZ_INLINE static const Uuid GetGenericClassInfoVectorTypeId()
+    AZ_INLINE static constexpr AZ::TypeId GetGenericClassInfoVectorTypeId()
     {
         return Uuid("{2BADE35A-6F1B-4698-B2BC-3373D010020C}");
     };
@@ -2167,23 +2167,23 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -2211,13 +2211,13 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
     };
 
-    AZ_INLINE static const Uuid GetGenericClassInfoFixedVectorTypeId()
+    AZ_INLINE static constexpr AZ::TypeId GetGenericClassInfoFixedVectorTypeId()
     {
         return Uuid("{6C6751B0-392A-4E71-8BF8-179484D7D22F}");
     };
@@ -2248,23 +2248,23 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -2292,7 +2292,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -2324,23 +2324,23 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -2368,7 +2368,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -2400,23 +2400,23 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -2444,13 +2444,13 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
     };
 
-    AZ_INLINE static const Uuid GetGenericClassInfoArrayTypeId()
+    AZ_INLINE static constexpr AZ::TypeId GetGenericClassInfoArrayTypeId()
     {
         return Uuid("{286E1198-0867-4198-95D3-6CC569658E07}");
     };
@@ -2482,23 +2482,23 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -2527,13 +2527,13 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
     };
 
-    AZ_INLINE static const Uuid GetGenericClassSetTypeId()
+    AZ_INLINE static constexpr AZ::TypeId GetGenericClassSetTypeId()
     {
         return Uuid("{4A64D2A5-7265-4E3D-805C-BA2D0626F542}");
     };
@@ -2564,22 +2564,22 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t /*element*/) override
+            AZ::TypeId GetTemplatedTypeId(size_t /*element*/) override
             {
                 return SerializeGenericTypeInfo<K>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -2608,13 +2608,13 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
     };
 
-    AZ_INLINE static const Uuid GetGenericClassUnorderedSetTypeId()
+    AZ_INLINE static constexpr AZ::TypeId GetGenericClassUnorderedSetTypeId()
     {
         return Uuid("{B04E902E-C6F7-4212-A166-1B52F7437D3C}");
     };
@@ -2645,23 +2645,23 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<K>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -2690,7 +2690,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -2722,23 +2722,23 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<K>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -2767,13 +2767,13 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
     };
 
-    AZ_INLINE static const Uuid GetGenericOutcomeTypeId()
+    AZ_INLINE static constexpr AZ::TypeId GetGenericOutcomeTypeId()
     {
         return Uuid("{DF6803FE-1C95-4DB8-8C08-6CDA5353ACD7}");
     };
@@ -2804,7 +2804,7 @@ namespace AZ
                 return 2;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 if (element == 0)
                 {
@@ -2816,12 +2816,12 @@ namespace AZ
                 }
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<OutcomeType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
@@ -2852,13 +2852,13 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<OutcomeType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
     };
 
-    AZ_INLINE const Uuid GetGenericClassPairTypeId()
+    AZ_INLINE constexpr AZ::TypeId GetGenericClassPairTypeId()
     {
         return Uuid("{9F3F5302-3390-407a-A6F7-2E011E3BB686}");
     };
@@ -2889,7 +2889,7 @@ namespace AZ
                 return 2;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 if (element == 0)
                 {
@@ -2901,17 +2901,17 @@ namespace AZ
                 }
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<PairType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<PairType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -2944,13 +2944,13 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<PairType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
     };
 
-    AZ_INLINE const Uuid GetGenericClassTupleTypeId()
+    AZ_INLINE constexpr AZ::TypeId GetGenericClassTupleTypeId()
     {
         return Uuid("{F98DF943-F870-4FE2-B6A9-3E8BC5861782}");
     };
@@ -2981,7 +2981,7 @@ namespace AZ
                 return Internal::AZStdTupleContainer<TupleType>::s_tupleSize;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 if (GenericClassInfo* valueGenericClassInfo = m_tupleContainer.m_valueClassElements[element].m_genericClassInfo)
                 {
@@ -2990,17 +2990,17 @@ namespace AZ
                 return m_tupleContainer.m_valueClassElements[element].m_typeId;
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<TupleType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<TupleType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -3032,7 +3032,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<TupleType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -3051,7 +3051,7 @@ namespace AZ
                 + AZ::AzTypeInfo<T>::Name() + ">";
         public:
             GenericClassWrapper()
-                : m_classData{ SerializeContext::ClassData::Create<WrapperType>(ClassName.c_str(), "{642ABA5E-BB70-40EF-A986-933420D89F85}", Internal::NullFactory::GetInstance(), nullptr, &m_wrapperContainer) }
+                : m_classData{ SerializeContext::ClassData::Create<WrapperType>(ClassName.c_str(), AZ::TypeId("{642ABA5E-BB70-40EF-A986-933420D89F85}"), Internal::NullFactory::GetInstance(), nullptr, &m_wrapperContainer) }
             {
             }
 
@@ -3065,13 +3065,13 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<WrapperType>();
             }
@@ -3099,13 +3099,13 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<WrapperType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
     };
 
-    AZ_INLINE const Uuid GetGenericClassMapTypeId()
+    AZ_INLINE constexpr AZ::TypeId GetGenericClassMapTypeId()
     {
         return Uuid("{DB825311-453D-45C8-B07F-B9CD9A32ACB4}");
     };
@@ -3136,7 +3136,7 @@ namespace AZ
                 return 2;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 if (element == 0)
                 {
@@ -3148,17 +3148,17 @@ namespace AZ
                 }
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -3187,13 +3187,13 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
     };
 
-    AZ_INLINE static const Uuid GetGenericClassUnorderedMapTypeId()
+    AZ_INLINE static constexpr AZ::TypeId GetGenericClassUnorderedMapTypeId()
     {
         return Uuid("{18456A80-63CC-40c5-BF16-6AF94F9A9ECC}");
     };
@@ -3224,7 +3224,7 @@ namespace AZ
                 return 2;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 if (element == 0)
                 {
@@ -3236,17 +3236,17 @@ namespace AZ
                 }
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -3275,7 +3275,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -3307,7 +3307,7 @@ namespace AZ
                 return 2;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 if (element == 0)
                 {
@@ -3319,17 +3319,17 @@ namespace AZ
                 }
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -3358,7 +3358,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -3400,23 +3400,23 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<E>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -3440,7 +3440,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -3472,18 +3472,18 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
-                return SerializeGenericTypeInfo<AZ::u8>::GetClassTypeId();
+                return AzTypeInfo<AZ::u8>::Uuid();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
@@ -3507,7 +3507,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -3538,18 +3538,18 @@ namespace AZ
                 return 0;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
-                return SerializeGenericTypeInfo<AZ::u8>::GetClassTypeId();
+                return AzTypeInfo<AZ::u8>::Uuid();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
@@ -3573,7 +3573,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -3604,24 +3604,24 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
             // AZStdSmartPtrContainer uses the underlying smart_ptr container value_type typedef type id for serialization
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -3654,7 +3654,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -3685,24 +3685,24 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
             // AZStdSmartPtrContainer uses the underlying smart_ptr container value_type typedef type id for serialization
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -3735,7 +3735,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -3766,24 +3766,24 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
             // AZStdSmartPtrContainer uses the smart_ptr container type id for serialization
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
 
-            const Uuid& GetLegacySpecializedTypeId() const override
+            AZ::TypeId GetLegacySpecializedTypeId() const override
             {
                 return AZ::AzTypeInfo<ContainerType>::template Uuid<AZ::PointerRemovedTypeIdTag>();
             }
@@ -3816,7 +3816,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -3847,19 +3847,19 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
             }
 
             // AZStdOptionalContainer uses the underlying container value_type typedef type id for serialization
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<ContainerType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
@@ -3887,7 +3887,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ContainerType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }

+ 10 - 10
Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp

@@ -710,7 +710,7 @@ namespace AZ
         return nullptr;
     }
 
-    const TypeId& SerializeContext::GetUnderlyingTypeId(const TypeId& enumTypeId) const
+    AZ::TypeId SerializeContext::GetUnderlyingTypeId(const TypeId& enumTypeId) const
     {
         auto enumToUnderlyingTypeIdIter = m_enumTypeIdToUnderlyingTypeIdMap.find(enumTypeId);
         return enumToUnderlyingTypeIdIter != m_enumTypeIdToUnderlyingTypeIdMap.end() ? enumToUnderlyingTypeIdIter->second : enumTypeId;
@@ -2498,7 +2498,7 @@ namespace AZ
             {
                 if (cd.m_azRtti->IsTypeOf(typeId))
                 {
-                    if (!callback(&cd, nullptr))
+                    if (!callback(&cd, {}))
                     {
                         return;
                     }
@@ -2516,7 +2516,7 @@ namespace AZ
                             // if both classes have azRtti they will be enumerated already by the code above (azrtti)
                             if (cd.m_azRtti == nullptr || cd.m_elements[i].m_azRtti == nullptr)
                             {
-                                if (!callback(&cd, nullptr))
+                                if (!callback(&cd, {}))
                                 {
                                     return;
                                 }
@@ -2548,7 +2548,7 @@ namespace AZ
                     if (baseClassData)
                     {
                         callbackData.m_reportedTypes.push_back(baseClassData->m_typeId);
-                        if (!callback(baseClassData, nullptr))
+                        if (!callback(baseClassData, {}))
                         {
                             return;
                         }
@@ -2741,20 +2741,20 @@ namespace AZ
     void SerializeContext::IDataContainer::DeletePointerData(SerializeContext* context, const ClassElement* classElement, const void* element)
     {
         AZ_Assert(context != nullptr && classElement != nullptr && element != nullptr, "Invalid input");
-        const AZ::Uuid* elemUuid = &classElement->m_typeId;
+        AZ::Uuid elemUuid = classElement->m_typeId;
         // find the class data for the specific element
-        const SerializeContext::ClassData* classData = classElement->m_genericClassInfo ? classElement->m_genericClassInfo->GetClassData() : context->FindClassData(*elemUuid, nullptr, 0);
+        const SerializeContext::ClassData* classData = classElement->m_genericClassInfo ? classElement->m_genericClassInfo->GetClassData() : context->FindClassData(elemUuid, nullptr, 0);
         if (classElement->m_flags & SerializeContext::ClassElement::FLG_POINTER)
         {
             const void* dataPtr = *reinterpret_cast<void* const*>(element);
             // if dataAddress is a pointer in this case, cast it's value to a void* (or const void*) and dereference to get to the actual class.
             if (dataPtr && classElement->m_azRtti)
             {
-                const AZ::Uuid* actualClassId = &classElement->m_azRtti->GetActualUuid(dataPtr);
-                if (*actualClassId != *elemUuid)
+                const AZ::Uuid actualClassId = classElement->m_azRtti->GetActualUuid(dataPtr);
+                if (actualClassId != elemUuid)
                 {
                     // we are pointing to derived type, adjust class data, uuid and pointer.
-                    classData = context->FindClassData(*actualClassId, nullptr, 0);
+                    classData = context->FindClassData(actualClassId, nullptr, 0);
                     elemUuid = actualClassId;
                     if (classData)
                     {
@@ -2769,7 +2769,7 @@ namespace AZ
             {
                 const void* dataPtr = *reinterpret_cast<void* const*>(element);
                 AZ_UNUSED(dataPtr); // this prevents a L4 warning if the below line is stripped out in release.
-                AZ_Warning("Serialization", false, "Failed to find class id%s for %p! Memory could leak.", elemUuid->ToString<AZStd::string>().c_str(), dataPtr);
+                AZ_Warning("Serialization", false, "Failed to find class id%s for %p! Memory could leak.", elemUuid.ToFixedString().c_str(), dataPtr);
             }
             return;
         }

+ 18 - 18
Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h

@@ -1121,7 +1121,7 @@ namespace AZ
          * and the enum type is registered with the SerializeContext
          * otherwise the supplied typeId is returned
         */
-        const TypeId& GetUnderlyingTypeId(const TypeId& enumTypeId) const;
+        AZ::TypeId GetUnderlyingTypeId(const TypeId& enumTypeId) const;
 
     private:
 
@@ -1398,13 +1398,13 @@ namespace AZ
 
         virtual size_t GetNumTemplatedArguments() = 0;
 
-        virtual const Uuid& GetTemplatedTypeId(size_t element) = 0;
+        virtual AZ::TypeId GetTemplatedTypeId(size_t element) = 0;
 
         /// By default returns AzTypeInfo<ValueType>::Uuid
-        virtual const Uuid& GetSpecializedTypeId() const = 0;
+        virtual AZ::TypeId GetSpecializedTypeId() const = 0;
 
         /// Return the generic Type Id associated with the GenericClassInfo
-        virtual const Uuid& GetGenericTypeId() const { return GetSpecializedTypeId(); }
+        virtual AZ::TypeId GetGenericTypeId() const { return GetSpecializedTypeId(); }
 
         /// Register the generic class info using the SerializeContext
         virtual void Reflect(SerializeContext*) = 0;
@@ -1414,7 +1414,7 @@ namespace AZ
 
         /// Returns the legacy specialized type id which removed the pointer types from templates when calculating type ids.
         /// i.e Typeids for AZStd::vector<AZ::Entity> and AZStd::vector<AZ::Entity*> are the same for legacy ids
-        virtual const Uuid& GetLegacySpecializedTypeId() const { return GetSpecializedTypeId(); }
+        virtual AZ::TypeId GetLegacySpecializedTypeId() const { return GetSpecializedTypeId(); }
     };
 
     /**
@@ -1440,7 +1440,7 @@ namespace AZ
         /// By default we don't have generic class info
         static GenericClassInfo* GetGenericInfo() { return nullptr; }
         /// By default just return the ValueTypeInfo
-        static const Uuid& GetClassTypeId();
+        static constexpr Uuid GetClassTypeId();
     };
 
     /**
@@ -1597,15 +1597,15 @@ namespace AZ
     struct SerializeTypeInfo
     {
         typedef typename AZStd::remove_pointer<T>::type ValueType;
-        static const Uuid& GetUuid(const T* instance = nullptr)
+        static Uuid GetUuid(const T* instance = nullptr)
         {
             return GetUuid(instance, typename AZStd::is_pointer<T>::type());
         }
-        static const Uuid& GetUuid(const T* instance, const AZStd::true_type& /*is_pointer<T>*/)
+        static Uuid GetUuid(const T* instance, const AZStd::true_type& /*is_pointer<T>*/)
         {
             return GetUuidHelper(instance ? *instance : nullptr, typename HasAZRtti<ValueType>::type());
         }
-        static const Uuid& GetUuid(const T* instance, const AZStd::false_type& /*is_pointer<T>*/)
+        static Uuid GetUuid(const T* instance, const AZStd::false_type& /*is_pointer<T>*/)
         {
             return GetUuidHelper(instance, typename HasAZRtti<ValueType>::type());
         }
@@ -1626,16 +1626,16 @@ namespace AZ
             return "NotAZRttiType";
         }
 
-        static const Uuid& GetRttiTypeId(ValueType* const* instance)
+        static AZ::TypeId GetRttiTypeId(ValueType* const* instance)
         {
             return GetRttiTypeId(instance ? *instance : nullptr, typename HasAZRtti<ValueType>::type());
         }
-        static const Uuid& GetRttiTypeId(const ValueType* instance) { return GetRttiTypeId(instance, typename HasAZRtti<ValueType>::type()); }
-        static const Uuid& GetRttiTypeId(const ValueType* instance, const AZStd::true_type& /*HasAZRtti<ValueType>*/)
+        static AZ::TypeId GetRttiTypeId(const ValueType* instance) { return GetRttiTypeId(instance, typename HasAZRtti<ValueType>::type()); }
+        static AZ::TypeId GetRttiTypeId(const ValueType* instance, const AZStd::true_type& /*HasAZRtti<ValueType>*/)
         {
             return instance ? AZ::RttiTypeId(instance) : AzTypeInfo<ValueType>::Uuid();
         }
-        static const Uuid& GetRttiTypeId(const ValueType* /*instance*/, const AZStd::false_type& /*!HasAZRtti<ValueType>*/)
+        static AZ::TypeId GetRttiTypeId(const ValueType* /*instance*/, const AZStd::false_type& /*!HasAZRtti<ValueType>*/)
         {
             static Uuid s_nullUuid = Uuid::CreateNull();
             return s_nullUuid;
@@ -1694,11 +1694,11 @@ namespace AZ
         }
 
     private:
-        static const AZ::Uuid& GetUuidHelper(const ValueType* /* ptr */, const AZStd::false_type& /* !HasAZRtti<U>::type() */)
+        static AZ::Uuid GetUuidHelper(const ValueType* /* ptr */, const AZStd::false_type& /* !HasAZRtti<U>::type() */)
         {
             return SerializeGenericTypeInfo<ValueType>::GetClassTypeId();
         }
-        static const AZ::Uuid& GetUuidHelper(const ValueType* ptr, const AZStd::true_type& /* HasAZRtti<U>::type() */)
+        static AZ::Uuid GetUuidHelper(const ValueType* ptr, const AZStd::true_type& /* HasAZRtti<U>::type() */)
         {
             return ptr ? AZ::RttiTypeId(ptr) : SerializeGenericTypeInfo<ValueType>::GetClassTypeId();
         }
@@ -1927,7 +1927,7 @@ namespace AZ
 
 
                 // Remove the deprecated type name -> typeid mapping
-                auto RemoveDeprecatedNames = [this, &typeUuid](AZStd::string_view deprecatedName)
+                auto RemoveDeprecatedNames = [this, &typeUuid = typeUuid](AZStd::string_view deprecatedName)
                 {
                     auto deprecatedNameRange = m_deprecatedNameToTypeIdMap.equal_range(Crc32(deprecatedName));
                     for (auto classNameRangeIter = deprecatedNameRange.first; classNameRangeIter != deprecatedNameRange.second;)
@@ -1965,7 +1965,7 @@ namespace AZ
         else
         {
             // Add any the deprecated type names to the deprecated type name to type id map
-            auto AddDeprecatedNames = [this, &typeUuid](AZStd::string_view deprecatedName)
+            auto AddDeprecatedNames = [this, &typeUuid = typeUuid](AZStd::string_view deprecatedName)
             {
                 m_deprecatedNameToTypeIdMap.emplace(deprecatedName, typeUuid);
             };
@@ -2512,7 +2512,7 @@ namespace AZ
     // SerializeGenericTypeInfo<ValueType>::GetClassTypeId
     //=========================================================================
     template<class ValueType>
-    const Uuid& SerializeGenericTypeInfo<ValueType>::GetClassTypeId()
+    constexpr Uuid SerializeGenericTypeInfo<ValueType>::GetClassTypeId()
     {
         // Detect the scenario when an enum type doesn't specialize AzTypeInfo
         // The underlying type Uuid is returned instead

+ 2 - 1
Code/Framework/AzCore/AzCore/Serialization/Utils.h

@@ -30,7 +30,8 @@ namespace AZ
         template <typename ObjectType>
         ObjectType* LoadObjectFromStream(IO::GenericStream& stream, SerializeContext* context = nullptr, const FilterDescriptor& filterDesc = FilterDescriptor())
         {
-            return reinterpret_cast<ObjectType*>(LoadObjectFromStream(stream, context, &AzTypeInfo<ObjectType>::Uuid(), filterDesc));
+            constexpr Uuid objectTypeId = AzTypeInfo<ObjectType>::Uuid();
+            return reinterpret_cast<ObjectType*>(LoadObjectFromStream(stream, context, &objectTypeId, filterDesc));
         }
 
         template <typename ObjectType>

+ 4 - 4
Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl

@@ -446,7 +446,7 @@ namespace AZ
                 return sizeof...(Types);
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 if (GenericClassInfo* valueGenericClassInfo = m_variantContainer.m_alternativeClassElements[element].m_genericClassInfo)
                 {
@@ -455,12 +455,12 @@ namespace AZ
                 return m_variantContainer.m_alternativeClassElements[element].m_typeId;
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<VariantType>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
@@ -519,7 +519,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<VariantType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }

+ 6 - 6
Code/Framework/AzCore/AzCore/Settings/ConfigurableStack.h

@@ -80,7 +80,7 @@ namespace AZ
 
         virtual ~ConfigurableStackInterface() = default;
 
-        virtual const TypeId& GetNodeType() const = 0;
+        virtual TypeId GetNodeType() const = 0;
 
     protected:
         enum class InsertPosition
@@ -104,7 +104,7 @@ namespace AZ
 
         ~ConfigurableStack() override = default;
 
-        const TypeId& GetNodeType() const override;
+        TypeId GetNodeType() const override;
 
         Iterator begin();
         Iterator end();
@@ -139,9 +139,9 @@ namespace AZ
 
             SerializeContext::ClassData* GetClassData() override;
             size_t GetNumTemplatedArguments() override;
-            const Uuid& GetTemplatedTypeId([[maybe_unused]] size_t element) override;
-            const Uuid& GetSpecializedTypeId() const override;
-            const Uuid& GetGenericTypeId() const override;
+            AZ::TypeId GetTemplatedTypeId([[maybe_unused]] size_t element) override;
+            AZ::TypeId GetSpecializedTypeId() const override;
+            AZ::TypeId GetGenericTypeId() const override;
             
             void Reflect(SerializeContext* serializeContext) override;
 
@@ -151,7 +151,7 @@ namespace AZ
         using ClassInfoType = GenericConfigurableStackInfo;
 
         static ClassInfoType* GetGenericInfo();
-        static const Uuid& GetClassTypeId();
+        static AZ::TypeId GetClassTypeId();
     };
 
     class JsonConfigurableStackSerializer : public BaseJsonSerializer

+ 5 - 5
Code/Framework/AzCore/AzCore/Settings/ConfigurableStack.inl

@@ -15,7 +15,7 @@ namespace AZ
     //
 
     template<typename StackBaseType>
-    const TypeId& ConfigurableStack<StackBaseType>::GetNodeType() const
+    TypeId ConfigurableStack<StackBaseType>::GetNodeType() const
     {
         return azrtti_typeid<NodeValue>();
     }
@@ -115,20 +115,20 @@ namespace AZ
     }
 
     template<typename StackBaseType>
-    const Uuid& SerializeGenericTypeInfo<ConfigurableStack<StackBaseType>>::GenericConfigurableStackInfo::GetTemplatedTypeId(
+    AZ::TypeId SerializeGenericTypeInfo<ConfigurableStack<StackBaseType>>::GenericConfigurableStackInfo::GetTemplatedTypeId(
         [[maybe_unused]] size_t element)
     {
         return SerializeGenericTypeInfo<StackBaseType>::GetClassTypeId();
     }
 
     template<typename StackBaseType>
-    const Uuid& SerializeGenericTypeInfo<ConfigurableStack<StackBaseType>>::GenericConfigurableStackInfo::GetSpecializedTypeId() const
+    AZ::TypeId SerializeGenericTypeInfo<ConfigurableStack<StackBaseType>>::GenericConfigurableStackInfo::GetSpecializedTypeId() const
     {
         return azrtti_typeid<ConfigurableStackType>();
     }
 
     template<typename StackBaseType>
-    const Uuid& SerializeGenericTypeInfo<ConfigurableStack<StackBaseType>>::GenericConfigurableStackInfo::GetGenericTypeId() const
+    AZ::TypeId SerializeGenericTypeInfo<ConfigurableStack<StackBaseType>>::GenericConfigurableStackInfo::GetGenericTypeId() const
     {
         return TYPEINFO_Uuid();
     }
@@ -153,7 +153,7 @@ namespace AZ
     }
 
     template<typename StackBaseType>
-    const Uuid& SerializeGenericTypeInfo<ConfigurableStack<StackBaseType>>::GetClassTypeId()
+    AZ::TypeId SerializeGenericTypeInfo<ConfigurableStack<StackBaseType>>::GetClassTypeId()
     {
         return GetGenericInfo()->GetClassData()->m_typeId;
     }

+ 1 - 0
Code/Framework/AzCore/AzCore/azcore_files.cmake

@@ -359,6 +359,7 @@ set(FILES
     Math/TransformSerializer.h
     Math/Uuid.cpp
     Math/Uuid.h
+    Math/Uuid.inl
     Math/UuidSerializer.h
     Math/UuidSerializer.cpp
     Math/Vector2.cpp

+ 70 - 0
Code/Framework/AzCore/AzCore/base.h

@@ -199,6 +199,76 @@ namespace AZ
     template<typename T>
     inline T* PointerAlignDown(T* p, size_t a) { return reinterpret_cast<T*>((reinterpret_cast<size_t>(p)) & ~(a-1));   }
 
+    //! Rounds up a value to next power of 2.
+    //! For example to round 8388609((2^23) + 1) up to 16777216(2^24) the following occurs
+    //! Subtract one from the value in case it is already
+    //! equal to a power of 2
+    //! 8388609 - 1 = 8388608
+    //! Propagate the highest one bit in the value to all the lower bits
+    //! 8388608 = 0b100'0000'0000'0000'0000'0000 in binary
+    //!
+    //!  0b100'0000'0000'0000'0000'0000
+    //! |0b010'0000'0000'0000'0000'0000 (>> 1)
+    //! -------------------------------
+    //!  0b110'0000'0000'0000'0000'0000 (Now there are 2 consecutive 1-bits)
+    //! |0b001'1000'0000'0000'0000'0000 (>> 2)
+    //! -------------------------------
+    //!  0b111'1000'0000'0000'0000'0000 (Now there are 4 consecutive 1-bits)
+    //! |0b000'0111'1000'0000'0000'0000 (>> 4)
+    //! -------------------------------
+    //!  0b111'1111'1000'0000'0000'0000 (Now there are 8 consecutive 1-bits)
+    //! |0b000'0000'0111'1111'1000'0000 (>> 8)
+    //! -------------------------------
+    //!  0b111'1111'1111'1111'1000'0000 (Now there are 16 consecutive 1-bits)
+    //! |0b000'0000'0000'0000'0111'1111 (>> 16)
+    //! -------------------------------
+    //!  0b111'1111'1111'1111'1111'1111 (Now there are 23 consecutive 1-bits)
+    //! |0b000'0000'0000'0000'0000'0000 (>> 32)
+    //! -------------------------------
+    //!  0b111'1111'1111'1111'1111'1111
+    //! Finally since all the one bits are set in the value, adding one pushes it
+    //! to next power of 2
+    //! 0b1000'0000'0000'0000'0000'0000 = 16777216
+    inline constexpr size_t AlignUpToPowerOfTwo(size_t value)
+    {
+        // If the value is <=2 it is already aligned
+        if (value <= 2)
+        {
+            return value;
+        }
+
+        // Subtract one to make any values already
+        // aligned to a power of 2 less than that power of 2
+        // so that algorithm doesn't push those values upwards
+        --value;
+        value |= value >> 0b1;
+        value |= value >> 0b10;
+        value |= value >> 0b100;
+        value |= value >> 0b1000;
+        value |= value >> 0b1'0000;
+        value |= value >> 0b10'0000;
+        ++value;
+        return value;
+    }
+
+    static_assert(AlignUpToPowerOfTwo(0) == 0);
+    static_assert(AlignUpToPowerOfTwo(1) == 1);
+    static_assert(AlignUpToPowerOfTwo(2) == 2);
+    static_assert(AlignUpToPowerOfTwo(3) == 4);
+    static_assert(AlignUpToPowerOfTwo(4) == 4);
+    static_assert(AlignUpToPowerOfTwo(5) == 8);
+    static_assert(AlignUpToPowerOfTwo(8) == 8);
+    static_assert(AlignUpToPowerOfTwo(10) == 16);
+    static_assert(AlignUpToPowerOfTwo(16) == 16);
+    static_assert(AlignUpToPowerOfTwo(24) == 32);
+    static_assert(AlignUpToPowerOfTwo(32) == 32);
+    static_assert(AlignUpToPowerOfTwo(45) == 64);
+    static_assert(AlignUpToPowerOfTwo(64) == 64);
+    static_assert(AlignUpToPowerOfTwo(112) == 128);
+    static_assert(AlignUpToPowerOfTwo(128) == 128);
+    static_assert(AlignUpToPowerOfTwo(136) == 256);
+    static_assert(AlignUpToPowerOfTwo(256) == 256);
+
     /**
     * Does an safe alias cast using a union. This will allow you to properly cast types that when
     * strict aliasing is enabled.

+ 234 - 5
Code/Framework/AzCore/AzCore/std/ranges/ranges_algorithm.h

@@ -13,6 +13,7 @@
 #include <AzCore/std/ranges/ranges_functional.h>
 #include <AzCore/std/ranges/subrange.h>
 #include <AzCore/std/reference_wrapper.h>
+#include <AzCore/std/utility/as_const.h>
 
 namespace AZStd::ranges
 {
@@ -61,7 +62,6 @@ namespace AZStd::ranges
         }
     };
 
-
     template<class I, class O>
     struct in_out_result
     {
@@ -81,6 +81,50 @@ namespace AZStd::ranges
         }
     };
 
+    template<class I1, class I2, class O>
+    struct in_in_out_result
+    {
+        AZ_NO_UNIQUE_ADDRESS I1 in1;
+        AZ_NO_UNIQUE_ADDRESS I2 in2;
+        AZ_NO_UNIQUE_ADDRESS O out;
+
+        template<class II1, class II2, class OO, class = enable_if_t<
+            convertible_to<const I1&, II1>
+            && convertible_to<const I2&, II2>
+            && convertible_to<const O&, OO>>>
+        constexpr operator in_in_out_result<II1, II2, OO>() const&
+        {
+            return { in1, in2, out };
+        }
+
+        template<class II1, class II2, class OO, class = enable_if_t<
+            convertible_to<I1, II1>
+            && convertible_to<I2, II2>
+            && convertible_to<O, OO>>>
+        constexpr operator in_in_out_result<II1, II2, OO>() &&
+        {
+            return { AZStd::move(in1), AZStd::move(in2), AZStd::move(out) };
+        }
+    };
+
+    template<class O, class T>
+    struct out_value_result
+    {
+        AZ_NO_UNIQUE_ADDRESS O out;
+        AZ_NO_UNIQUE_ADDRESS T value;
+
+        template<class O2, class T2, class = enable_if_t<convertible_to<const O&, O2> && convertible_to<const T&, T2>>>
+        constexpr operator out_value_result<O2, T2>() const&
+        {
+            return { out, value };
+        }
+
+        template<class O2, class T2, class = enable_if_t<convertible_to<O, O2> && convertible_to<T, T2>>>
+        constexpr operator out_value_result<O2, T2>() &&
+        {
+            return { AZStd::move(out), AZStd::move(value) };
+        }
+    };
 
     namespace Internal
     {
@@ -1022,6 +1066,59 @@ namespace AZStd::ranges
         constexpr Internal::equal_fn equal{};
     }
 
+    namespace Internal
+    {
+        struct lexicographical_compare_fn
+        {
+            template<class I1, class S1, class I2, class S2, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity,
+                class = enable_if_t<conjunction_v<
+                bool_constant<input_iterator<I1>>,
+                bool_constant<sentinel_for<S1, I1>>,
+                bool_constant<input_iterator<I2>>,
+                bool_constant<sentinel_for<S2, I2>>,
+                bool_constant<indirect_strict_weak_order<Comp, projected<I1, Proj1>, projected<I2, Proj2>>>
+                >>>
+                constexpr bool operator()(I1 first1, S1 last1, I2 first2, S2 last2,
+                    Comp compd = {},
+                    Proj1 proj1 = {}, Proj2 proj2 = {}) const
+            {
+                for (; first1 != last1 && first2 != last2; ++first1, ++first2)
+                {
+                    if (AZStd::invoke(compd, AZStd::invoke(proj1, *first1), AZStd::invoke(proj2, *first2)))
+                    {
+                        return true;
+                    }
+                    if (AZStd::invoke(compd, AZStd::invoke(proj2, *first2), AZStd::invoke(proj1, *first1)))
+                    {
+                        return false;
+                    }
+                }
+
+                // Each element in min(last1 - first1, last2 - first2) are not lexicographically less than each other
+                // The first sequence legnth is then check to see if it is smaller than the second sequence length
+                return first1 == last1 && first2 != last2;
+            }
+
+            template<class R1, class R2, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity,
+                class = enable_if_t<conjunction_v<
+                bool_constant<input_range<R1>>,
+                bool_constant<input_range<R2>>,
+                bool_constant<indirect_strict_weak_order<Comp, projected<iterator_t<R1>, Proj1>, projected<iterator_t<R2>, Proj2>>>
+                >>>
+                constexpr bool operator()(R1&& r1, R2&& r2, Comp compd = {},
+                    Proj1 proj1 = {}, Proj2 proj2 = {}) const
+            {
+                return operator()(ranges::begin(r1), ranges::end(r1),
+                    ranges::begin(r2), ranges::end(r2),
+                    AZStd::move(compd), AZStd::move(proj1), AZStd::move(proj2));
+            }
+        };
+    }
+    inline namespace customization_point_object
+    {
+        constexpr Internal::lexicographical_compare_fn lexicographical_compare{};
+    }
+
     namespace Internal
     {
         struct search_fn
@@ -1666,6 +1763,93 @@ namespace AZStd::ranges
         constexpr Internal::move_backward_fn move_backward{};
     }
 
+    // ranges::transform
+    template<class I, class O>
+    using unary_transform_result = in_out_result<I, O>;
+    template<class I1, class I2, class O>
+    using binary_transform_result = in_in_out_result<I1, I2, O>;
+
+    namespace Internal
+    {
+        struct transform_fn
+        {
+            template<class I, class S, class O, class F, class Proj = identity>
+            constexpr auto operator()(I first1, S last1, O result, F op, Proj proj = {}) const
+                -> enable_if_t<conjunction_v<
+                bool_constant<input_iterator<I>>,
+                bool_constant<sentinel_for<S, I>>,
+                bool_constant<weakly_incrementable<O>>,
+                bool_constant<copy_constructible<F>>,
+                bool_constant<indirectly_writable<O, indirect_result_t<F&, projected<I, Proj>>>>
+                >, unary_transform_result<I, O>>
+            {
+                for (; first1 != last1; ++first1, ++result)
+                {
+                    *result = AZStd::invoke(op, AZStd::invoke(proj, *first1));
+                }
+
+                return { first1, result };
+            }
+
+            template<class R, class O, class F, class Proj = identity>
+            constexpr auto operator()(R&& r, O result, F op, Proj proj = {}) const
+                -> enable_if_t<conjunction_v<
+                bool_constant<input_range<R>>,
+                bool_constant<weakly_incrementable<O>>,
+                bool_constant<copy_constructible<F>>,
+                bool_constant<indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R>, Proj>>>>
+                >, unary_transform_result<borrowed_iterator_t<R>, O>>
+            {
+                return operator()(AZStd::ranges::begin(r), AZStd::ranges::end(r), result,
+                    AZStd::move(op), AZStd::move(proj));
+            }
+
+            template<class I1, class S1, class I2, class S2, class O, class F,
+                class Proj1 = identity, class Proj2 = identity>
+            constexpr auto operator()(I1 first1, S1 last1, I2 first2, S2 last2, O result, F binary_op,
+                Proj1 proj1 = {}, Proj2 proj2 = {}) const
+                -> enable_if_t<conjunction_v<
+                bool_constant<input_iterator<I1>>,
+                bool_constant<sentinel_for<S1, I1>>,
+                bool_constant<input_iterator<I2>>,
+                bool_constant<sentinel_for<S2, I2>>,
+                bool_constant<weakly_incrementable<O>>,
+                bool_constant<copy_constructible<F>>,
+                bool_constant<indirectly_writable<O, indirect_result_t<F&, projected<I1, Proj1>, projected<I2, Proj2>>>>
+                >, binary_transform_result<I1, I2, O>>
+            {
+                for (; first1 != last1 && first2 != last2; ++first1, ++first2, ++result)
+                {
+                    *result = AZStd::invoke(binary_op, AZStd::invoke(proj1, *first1), AZStd::invoke(proj2, *first2));
+                }
+
+                return { first1, first2, result };
+            }
+
+            template<class R1, class R2, class O, class F,
+                class Proj1 = identity, class Proj2 = identity>
+            constexpr auto operator()(R1&& r1, R2&& r2, O result, F binary_op,
+                Proj1 proj1 = {}, Proj2 proj2 = {}) const
+                -> enable_if_t<conjunction_v<
+                bool_constant<input_range<R1>>,
+                bool_constant<input_range<R2>>,
+                bool_constant<weakly_incrementable<O>>,
+                bool_constant<copy_constructible<F>>,
+                bool_constant<indirectly_writable<O,
+                    indirect_result_t<F&, projected<iterator_t<R1>, Proj1>, projected<iterator_t<R2>, Proj2>>>>
+                >, binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>>
+            {
+                return operator()(AZStd::ranges::begin(r1), AZStd::ranges::end(r1),
+                    AZStd::ranges::begin(r2), AZStd::ranges::end(r2), AZStd::move(result),
+                    AZStd::move(binary_op), AZStd::move(proj1), AZStd::move(proj2));
+            }
+        };
+    }
+    inline namespace customization_point_object
+    {
+        constexpr Internal::transform_fn transform{};
+    }
+
     // ranges::contains
     // ranges::contains_subrange
     namespace Internal
@@ -1747,7 +1931,7 @@ namespace AZStd::ranges
                 bool_constant<sentinel_for<S2, I2>>,
                 bool_constant<indirectly_comparable<I1, I2, Pred, Proj1, Proj2>>
                 >>>
-                constexpr bool operator()(I1 first1, S1 last1, I2 first2, S2 last2,
+            constexpr bool operator()(I1 first1, S1 last1, I2 first2, S2 last2,
                     Pred pred = {},
                     Proj1 proj1 = {}, Proj2 proj2 = {}) const
             {
@@ -1762,7 +1946,7 @@ namespace AZStd::ranges
                 bool_constant<input_range<R2>>,
                 bool_constant<indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>>
                 >>>
-                constexpr bool operator()(R1&& r1, R2&& r2, Pred pred = {},
+            constexpr bool operator()(R1&& r1, R2&& r2, Pred pred = {},
                     Proj1 proj1 = {}, Proj2 proj2 = {}) const
             {
                 return operator()(ranges::begin(r1), ranges::end(r1),
@@ -1781,7 +1965,7 @@ namespace AZStd::ranges
                 bool_constant<sentinel_for<S2, I2>>,
                 bool_constant<indirectly_comparable<I1, I2, Pred, Proj1, Proj2>>
                 >>>
-                constexpr auto operator()(I1 first1, S1 last1, I2 first2, S2 last2,
+            constexpr auto operator()(I1 first1, S1 last1, I2 first2, S2 last2,
                     Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) const
                 -> enable_if_t<(forward_iterator<I1> || sized_sentinel_for<S1, I1>) &&
                     (forward_iterator<I2> || sized_sentinel_for<S2, I2>), bool>
@@ -1800,7 +1984,7 @@ namespace AZStd::ranges
                 bool_constant<input_range<R2>>,
                 bool_constant<indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>>
                 >>>
-                constexpr auto operator()(R1&& r1, R2&& r2,
+            constexpr auto operator()(R1&& r1, R2&& r2,
                     Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) const
                 -> enable_if_t<(forward_range<R1> || sized_range<R1>) &&
                     (forward_range<R2> || sized_range<R2>), bool>
@@ -1816,4 +2000,49 @@ namespace AZStd::ranges
         constexpr Internal::starts_with_fn starts_with{};
         constexpr Internal::ends_with_fn ends_with{};
     }
+
+    //! Constrained numeric algorithms
+    // ranges::iota
+
+    template<class O, class T>
+    using iota_result = out_value_result<O, T>;
+
+    namespace Internal
+    {
+        struct iota_fn
+        {
+            template<class O, class S, class T,
+                class = enable_if_t<conjunction_v<
+                bool_constant<input_or_output_iterator<O>>,
+                bool_constant<sentinel_for<S, O>>,
+                bool_constant<weakly_incrementable<T>>,
+                bool_constant<indirectly_writable<O, const T&>>
+                >>>
+            constexpr iota_result<O, T> operator()(O first, S last, T value) const
+            {
+                while( first != last)
+                {
+                    *first = as_const(value);
+                    ++first;
+                    ++value;
+                }
+
+                return { AZStd::move(first), AZStd::move(value) };
+            }
+
+            template<class T, class R,
+                class = enable_if_t<conjunction_v<
+                bool_constant<weakly_incrementable<T>>,
+                bool_constant<output_range<R, const T&>>
+                >>>
+            constexpr iota_result<borrowed_iterator_t<R>, T> operator()(R&& r, T value) const
+            {
+                return operator()(ranges::begin(r), ranges::end(r), AZStd::move(value));
+            }
+        };
+    }
+    inline namespace customization_point_object
+    {
+        constexpr Internal::iota_fn iota{};
+    }
 } // namespace AZStd::ranges

+ 59 - 56
Code/Framework/AzCore/AzCore/std/string/conversions.h

@@ -12,17 +12,14 @@
 
 #include <ctype.h>
 #include <wctype.h>
+#include <locale>
 
 //////////////////////////////////////////////////////////////////////////
 // utf8 cpp lib
 #include <AzCore/std/string/utf8/unchecked.h>
 //////////////////////////////////////////////////////////////////////////
 
-# define AZSTD_USE_OLD_RW_STL
 
-#if !defined(AZSTD_USE_OLD_RW_STL)
-#   include <locale>
-#endif
 
 namespace AZStd
 {
@@ -458,68 +455,60 @@ namespace AZStd
         }
     }
 
-    // Convert a range of chars to lower case
-#if defined(AZSTD_USE_OLD_RW_STL)
-    template<class Iterator>
-    void to_lower(Iterator first, Iterator last)
+
+    AZ_FORCE_INLINE size_t str_transform(char* destination, const char* source, size_t count)
     {
-        for (; first != last; ++first)
-        {
-            *first = static_cast<typename AZStd::iterator_traits<Iterator>::value_type>(tolower(*first));
-        }
+        return strxfrm(destination, source, count);
     }
 
-    // Convert a range of chars to upper case
-    template<class Iterator>
-    void to_upper(Iterator first, Iterator last)
+    AZ_FORCE_INLINE size_t str_transform(wchar_t* destination, const wchar_t* source, size_t count)
     {
-        for (; first != last; ++first)
-        {
-            *first = static_cast<typename AZStd::iterator_traits<Iterator>::value_type>(toupper(*first));
-        }
+        return wcsxfrm(destination, source, count);
     }
 
-    AZ_FORCE_INLINE size_t str_transform(char* destination, const char* source, size_t count)
+    // Use the C++ standard character classification functions and avoid the issue with negative integer values
+    template<class CharT> bool isalnum(CharT ch, const std::locale& loc = {})  { return std::isalnum(ch, loc); }
+    template<class CharT> bool isalpha(CharT ch, const std::locale& loc = {})  { return std::isalpha(ch, loc); }
+    template<class CharT> bool isblank(CharT ch, const std::locale& loc = {})  { return std::isalnum(ch, loc); }
+    template<class CharT> bool iscntrl(CharT ch, const std::locale& loc = {})  { return std::iscntrl(ch, loc); }
+    template<class CharT> bool isdigit(CharT ch, const std::locale& loc = {})  { return std::isdigit(ch, loc); }
+    template<class CharT> bool isgraph(CharT ch, const std::locale& loc = {})  { return std::isgraph(ch, loc); }
+    template<class CharT> bool islower(CharT ch, const std::locale& loc = {})  { return std::islower(ch, loc); }
+    template<class CharT> bool isprint(CharT ch, const std::locale& loc = {})  { return std::isprint(ch, loc); }
+    template<class CharT> bool ispunct(CharT ch, const std::locale& loc = {})  { return std::ispunct(ch, loc); }
+    template<class CharT> bool isspace(CharT ch, const std::locale& loc = {})  { return std::isspace(ch, loc); }
+    template<class CharT> bool isupper(CharT ch, const std::locale& loc = {})  { return std::isupper(ch, loc); }
+    template<class CharT> bool isxdigit(CharT ch, const std::locale& loc = {}) { return std::isxdigit(ch, loc); }
+
+    template<class CharT> bool is_alnum(CharT ch, const std::locale& loc = {})  { return std::isalnum(ch, loc); }
+    template<class CharT> bool is_alpha(CharT ch, const std::locale& loc = {})  { return std::isalpha(ch, loc); }
+    template<class CharT> bool is_blank(CharT ch, const std::locale& loc = {})  { return std::isalnum(ch, loc); }
+    template<class CharT> bool is_cntrl(CharT ch, const std::locale& loc = {})  { return std::iscntrl(ch, loc); }
+    template<class CharT> bool is_digit(CharT ch, const std::locale& loc = {})  { return std::isdigit(ch, loc); }
+    template<class CharT> bool is_graph(CharT ch, const std::locale& loc = {})  { return std::isgraph(ch, loc); }
+    template<class CharT> bool is_lower(CharT ch, const std::locale& loc = {})  { return std::islower(ch, loc); }
+    template<class CharT> bool is_print(CharT ch, const std::locale& loc = {})  { return std::isprint(ch, loc); }
+    template<class CharT> bool is_punct(CharT ch, const std::locale& loc = {})  { return std::ispunct(ch, loc); }
+    template<class CharT> bool is_space(CharT ch, const std::locale& loc = {})  { return std::isspace(ch, loc); }
+    template<class CharT> bool is_upper(CharT ch, const std::locale& loc = {})  { return std::isupper(ch, loc); }
+    template<class CharT> bool is_xdigit(CharT ch, const std::locale& loc = {}) { return std::isxdigit(ch, loc); }
+    // Wrap the std::locale tolower and toupper functions with a default std::locale argument
+    template<class charT>
+    charT tolower(charT ch, const std::locale& loc = {})
     {
-        return strxfrm(destination, source, count);
+        return std::tolower(ch , loc);
     }
 
-    AZ_FORCE_INLINE size_t str_transform(wchar_t* destination, const wchar_t* source, size_t count)
+    template<class charT>
+    charT toupper(charT ch, const std::locale& loc = {})
     {
-        return wcsxfrm(destination, source, count);
+        return std::toupper(ch , loc);
     }
 
-    // C standard requires that is_alpha and all the other below functions should be passed a positive integer
-    // (it will error if a negative value is passed in such as -128), which is what happens if you pass a char
-    // from the extended character set, without first converting it to an unsigned char, because it will
-    // automatically convert it to an int (-128) instead of to its ascii value (127), which is what these functions expect.
-    AZ_FORCE_INLINE bool is_alnum(char ch)          { return isalnum((unsigned char)ch) != 0; }
-    AZ_FORCE_INLINE bool is_alpha(char ch)          { return isalpha((unsigned char)ch) != 0; }
-    AZ_FORCE_INLINE bool is_cntrl(char ch)          { return iscntrl((unsigned char)ch) != 0; }
-    AZ_FORCE_INLINE bool is_digit(char ch)          { return isdigit((unsigned char)ch) != 0; }
-    AZ_FORCE_INLINE bool is_graph(char ch)          { return isgraph((unsigned char)ch) != 0; }
-    AZ_FORCE_INLINE bool is_lower(char ch)          { return islower((unsigned char)ch) != 0; }
-    AZ_FORCE_INLINE bool is_print(char ch)          { return isprint((unsigned char)ch) != 0; }
-    AZ_FORCE_INLINE bool is_punct(char ch)          { return ispunct((unsigned char)ch) != 0; }
-    AZ_FORCE_INLINE bool is_space(char ch)          { return isspace((unsigned char)ch) != 0; }
-    AZ_FORCE_INLINE bool is_upper(char ch)          { return isupper((unsigned char)ch) != 0; }
-    AZ_FORCE_INLINE bool is_xdigit(char ch)         { return isxdigit((unsigned char)ch) != 0; }
-
-    AZ_FORCE_INLINE bool is_alnum(wchar_t ch)       { return iswalnum(ch) != 0; }
-    AZ_FORCE_INLINE bool is_alpha(wchar_t ch)       { return iswalpha(ch) != 0; }
-    AZ_FORCE_INLINE bool is_cntrl(wchar_t ch)       { return iswcntrl(ch) != 0; }
-    AZ_FORCE_INLINE bool is_digit(wchar_t ch)       { return iswdigit(ch) != 0; }
-    AZ_FORCE_INLINE bool is_graph(wchar_t ch)       { return iswgraph(ch) != 0; }
-    AZ_FORCE_INLINE bool is_lower(wchar_t ch)       { return iswlower(ch) != 0; }
-    AZ_FORCE_INLINE bool is_print(wchar_t ch)       { return iswprint(ch) != 0; }
-    AZ_FORCE_INLINE bool is_punct(wchar_t ch)       { return iswpunct(ch) != 0; }
-    AZ_FORCE_INLINE bool is_space(wchar_t ch)       { return iswspace(ch) != 0; }
-    AZ_FORCE_INLINE bool is_upper(wchar_t ch)       { return iswupper(ch) != 0; }
-    AZ_FORCE_INLINE bool is_xdigit(wchar_t ch)      { return iswxdigit(ch) != 0; }
-
-#else // default standard implementation
+
+    // Convert a range of chars to lower case
     template<class Iterator>
-    void to_lower(Iterator first, Iterator last, const std::locale& loc = std::locale())
+    void to_lower(Iterator first, Iterator last, const std::locale& loc = {})
     {
         for (; first != last; ++first)
         {
@@ -527,15 +516,29 @@ namespace AZStd
         }
     }
 
+    template<class Range>
+    auto to_lower(Range&& r, const std::locale& loc = {})
+        -> enable_if_t<ranges::range<Range>
+            && indirectly_copyable<ranges::iterator_t<Range>, ranges::iterator_t<Range>>>
+    {
+        to_lower(ranges::begin(r), ranges::end(r), loc);
+    }
+
     // Convert a range of chars to upper case
     template<class Iterator>
-    void to_upper(Iterator first, Iterator last, const std::locale& loc = std::locale())
+    void to_upper(Iterator first, Iterator last, const std::locale& loc = {})
     {
         for (; first != last; ++first)
         {
             *first = std::toupper(*first, loc);
         }
     }
-#endif
-    // Add case insensitive compares
+
+    template<class Range>
+    auto to_upper(Range&& r, const std::locale& loc = {})
+        -> enable_if_t<ranges::range<Range>
+            && indirectly_copyable<ranges::iterator_t<Range>, ranges::iterator_t<Range>>>
+    {
+        to_upper(ranges::begin(r), ranges::end(r), loc);
+    }
 }

+ 1 - 1
Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/azcore.natvis

@@ -632,7 +632,7 @@
 
   <!-- Implementation without custom types added to the code or plug-ins, displays the UUID as 4 32 bit variables -->
   <Type Name="AZ::Uuid">
-    <DisplayString>{((((int)data[3] &amp; 0xFF)) + (((int)data[2] &amp; 0xFF) &lt;&lt; 8) + (((int)data[1] &amp; 0xFF) &lt;&lt; 16) + (((int)data[0] &amp; 0xFF) &lt;&lt; 24)),X} - {((((int)data[7] &amp; 0xFF)) + (((int)data[6] &amp; 0xFF) &lt;&lt; 8) + (((int)data[5] &amp; 0xFF) &lt;&lt; 16) + (((int)data[4] &amp; 0xFF) &lt;&lt; 24)),X} - {((((int)data[11] &amp; 0xFF)) + (((int)data[10] &amp; 0xFF) &lt;&lt; 8) + (((int)data[9] &amp; 0xFF) &lt;&lt; 16) + (((int)data[8] &amp; 0xFF) &lt;&lt; 24)),X} - {((((int)data[15] &amp; 0xFF)) + (((int)data[14] &amp; 0xFF) &lt;&lt; 8) + (((int)data[13] &amp; 0xFF) &lt;&lt; 16) + (((int)data[12] &amp; 0xFF) &lt;&lt; 24)),X}</DisplayString>
+    <DisplayString>{((((int)m_data[3] &amp; 0xFF)) + (((int)m_data[2] &amp; 0xFF) &lt;&lt; 8) + (((int)m_data[1] &amp; 0xFF) &lt;&lt; 16) + (((int)m_data[0] &amp; 0xFF) &lt;&lt; 24)),X} - {((((int)m_data[7] &amp; 0xFF)) + (((int)m_data[6] &amp; 0xFF) &lt;&lt; 8) + (((int)m_data[5] &amp; 0xFF) &lt;&lt; 16) + (((int)m_data[4] &amp; 0xFF) &lt;&lt; 24)),X} - {((((int)m_data[11] &amp; 0xFF)) + (((int)m_data[10] &amp; 0xFF) &lt;&lt; 8) + (((int)m_data[9] &amp; 0xFF) &lt;&lt; 16) + (((int)m_data[8] &amp; 0xFF) &lt;&lt; 24)),X} - {((((int)m_data[15] &amp; 0xFF)) + (((int)m_data[14] &amp; 0xFF) &lt;&lt; 8) + (((int)m_data[13] &amp; 0xFF) &lt;&lt; 16) + (((int)m_data[12] &amp; 0xFF) &lt;&lt; 24)),X}</DisplayString>
   </Type>
 
   <Type Name="AZ::EntityId">

+ 1 - 1
Code/Framework/AzCore/Platform/Windows/AzCore/Platform_Windows.cpp

@@ -62,7 +62,7 @@ namespace AZ
 
                 Sha1 hash;
                 AZ::u32 digest[5] = { 0 };
-                hash.ProcessBytes(machineInfo, wcslen(machineInfo) * sizeof(TCHAR));
+                hash.ProcessBytes(AZStd::as_bytes(AZStd::span{ (machineInfo), wcslen(machineInfo) * sizeof(TCHAR) }));
                 hash.GetDigest(digest);
                 s_machineId = digest[0];
                 if (s_machineId == 0)

+ 88 - 0
Code/Framework/AzCore/Tests/AZStd/RangesAlgorithmTests.cpp

@@ -237,6 +237,31 @@ namespace UnitTest
         EXPECT_FALSE(AZStd::ranges::equal(testVector, unequalVector));
     }
 
+    TEST_F(RangesAlgorithmTestFixture, RangesLexicographicalCompare_IsAbleToCompareTwoRanges_ReturnsSmallerRange)
+    {
+        AZStd::vector testVector{ 5, 1, 22, 47, -8, -5, 1000, 687, 22, -8, -8, 1000, 45 };
+        AZStd::vector longerVector{ 5, 1, 22, 47, -8, -5, 1000, 687, 22, -8, -8, 1000, 45, 929 };
+        AZStd::vector shorterVector{ 5, 1, 22, 47, -8, -5, 1000, 687, 22, -8, -8, 1000 };
+        AZStd::vector unequalVector{ 5, 1, 22, 47, -8, -5, 1000, 14, 22, -8, -8, 1000, 25 };
+
+        const AZStd::vector<int> emptyVector;
+        EXPECT_FALSE(AZStd::ranges::lexicographical_compare(emptyVector, emptyVector));
+        EXPECT_TRUE(AZStd::ranges::lexicographical_compare(emptyVector, testVector));
+        EXPECT_FALSE(AZStd::ranges::lexicographical_compare(testVector, emptyVector));
+
+        // testVector is a proper prefix of longerVector
+        EXPECT_TRUE(AZStd::ranges::lexicographical_compare(testVector, longerVector));
+        EXPECT_FALSE(AZStd::ranges::lexicographical_compare(longerVector, testVector));
+
+        // shorterVector is a proper prefix of shorterVector
+        EXPECT_FALSE(AZStd::ranges::lexicographical_compare(testVector, shorterVector));
+        EXPECT_TRUE(AZStd::ranges::lexicographical_compare(shorterVector, testVector));
+
+        // testVector and unequalVector are the same size, but have different element values
+        EXPECT_FALSE(AZStd::ranges::lexicographical_compare(testVector, unequalVector));
+        EXPECT_TRUE(AZStd::ranges::lexicographical_compare(unequalVector, testVector));
+    }
+
     TEST_F(RangesAlgorithmTestFixture, RangesMismatch_Returns_IteratorsToMismatchElements)
     {
         AZStd::vector testVector{ 1, 2, 3, 4, 5 ,6 };
@@ -441,6 +466,50 @@ namespace UnitTest
         EXPECT_THAT(testString, ::testing::ElementsAre('\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'));
     }
 
+    TEST_F(RangesAlgorithmTestFixture, RangesTransform_UnaryConvertsInPlace_Succeeds)
+    {
+        const char* expectedString = "ifmmp";
+        AZStd::string testString = "hello";
+        constexpr auto incrementChar = [](char elem) { return static_cast<char>(elem + 1); };
+        auto unaryResult = AZStd::ranges::transform(testString, testString.begin(), incrementChar);
+        EXPECT_EQ(testString.end(), unaryResult.in);
+        EXPECT_EQ(testString.end(), unaryResult.out);
+        EXPECT_EQ(expectedString, testString);
+    }
+
+    TEST_F(RangesAlgorithmTestFixture, RangesTransform_UnaryModifiesOtherRange_Succeeds)
+    {
+        AZStd::string testString = "hello";
+        AZStd::vector<int> ordinals;
+        auto unaryResult = AZStd::ranges::transform(testString, AZStd::back_inserter(ordinals), AZStd::identity{});
+        EXPECT_EQ(testString.end(), unaryResult.in);
+
+        EXPECT_THAT(ordinals, ::testing::ElementsAre('h', 'e', 'l', 'l', 'o'));
+    }
+
+     TEST_F(RangesAlgorithmTestFixture, RangesTransform_BinaryCombinesTwoRanges_Succeeds)
+    {
+        AZStd::array testArray1{1, 4, 9, 16};
+        AZStd::array testArray2{2, 4, 6, 8};
+        AZStd::vector<int> ordinals;
+        constexpr auto AddNumbers = [](int left, int right) { return left + right; };
+        auto binaryResult = AZStd::ranges::transform(testArray1, testArray2, AZStd::back_inserter(ordinals), AddNumbers);
+        EXPECT_EQ(testArray1.end(), binaryResult.in1);
+        EXPECT_EQ(testArray2.end(), binaryResult.in2);
+
+        EXPECT_THAT(ordinals, ::testing::ElementsAre(3, 8, 15, 24));
+    }
+
+    TEST_F(RangesAlgorithmTestFixture, RangesTransform_ModifiesOtherRange_Succeeds)
+    {
+        AZStd::string testString = "hello";
+        AZStd::vector<int> ordinals;
+        auto unaryResult = AZStd::ranges::transform(testString, AZStd::back_inserter(ordinals), AZStd::identity{});
+        EXPECT_EQ(testString.end(), unaryResult.in);
+
+        EXPECT_THAT(ordinals, ::testing::ElementsAre('h', 'e', 'l', 'l', 'o'));
+    }
+
     TEST_F(RangesAlgorithmTestFixture, RangesContains_LocatesElementInContainer_Succeeds)
     {
         AZStd::vector testVector{ 5, 1, 22, 47, -8, -5, 1000, 687, 22, -8, 1000, 45 };
@@ -500,4 +569,23 @@ namespace UnitTest
         EXPECT_TRUE(AZStd::ranges::ends_with(testVector, shorterVector));
         EXPECT_FALSE(AZStd::ranges::ends_with(shorterVector, testVector));
     }
+
+    TEST_F(RangesAlgorithmTestFixture, RangesIota_IncrementsSequence_UntilOfRange)
+    {
+        constexpr int vectorSize = 10;
+        AZStd::vector<int> testVector(vectorSize);
+        constexpr int startValue = -4;
+        auto result = AZStd::ranges::iota(testVector, startValue);
+
+        EXPECT_EQ(startValue + vectorSize, result.value);
+        EXPECT_EQ(testVector.end(), result.out);
+
+        AZStd::vector<int> expectedVector;
+        expectedVector.reserve(vectorSize);
+        for (int i = 0; i < vectorSize; ++i)
+        {
+            expectedVector.push_back(startValue + i);
+        }
+        EXPECT_THAT(testVector, ::testing::ContainerEq(expectedVector));
+    }
 }

+ 12 - 12
Code/Framework/AzCore/Tests/Asset/AssetManagerLoadingTests.cpp

@@ -687,8 +687,8 @@ namespace UnitTest
         // Dispatched event leads to another blocking load of asset B
 
         // Setup
-        constexpr char AssetNoRefA[] = "{EC5E3E4F-518C-4B03-A8BF-C9966CF763EB}";
-        constexpr char AssetNoRefB[] = "{C07E55B5-E60C-4575-AE07-32DD3DC68B1A}";
+        constexpr auto AssetNoRefA = AZ::Uuid("{EC5E3E4F-518C-4B03-A8BF-C9966CF763EB}");
+        constexpr auto AssetNoRefB = AZ::Uuid("{C07E55B5-E60C-4575-AE07-32DD3DC68B1A}");
 
         {
             m_assetHandlerAndCatalog->AddAsset<AssetWithSerializedData>(AssetNoRefA, "a.txt");
@@ -2004,21 +2004,21 @@ namespace UnitTest
         : public DisklessAssetManagerBase
     {
     public:
-        static inline const AZ::Uuid MyAsset1Id{ "{5B29FE2B-6B41-48C9-826A-C723951B0560}" };
-        static inline const AZ::Uuid MyAsset2Id{ "{BD354AE5-B5D5-402A-A12E-BE3C96F6522B}" };
-        static inline const AZ::Uuid MyAsset3Id{ "{622C3FC9-5AE2-4E52-AFA2-5F7095ADAB53}" };
-        static inline const AZ::Uuid MyAsset4Id{ "{EE99215B-7AB4-4757-B8AF-F78BD4903AC4}" };
-        static inline const AZ::Uuid MyAsset5Id{ "{D9CDAB04-D206-431E-BDC0-1DD615D56197}" };
-        static inline const AZ::Uuid MyAsset6Id{ "{B2F139C3-5032-4B52-ADCA-D52A8F88E043}" };
+        static inline constexpr AZ::Uuid MyAsset1Id{ "{5B29FE2B-6B41-48C9-826A-C723951B0560}" };
+        static inline constexpr AZ::Uuid MyAsset2Id{ "{BD354AE5-B5D5-402A-A12E-BE3C96F6522B}" };
+        static inline constexpr AZ::Uuid MyAsset3Id{ "{622C3FC9-5AE2-4E52-AFA2-5F7095ADAB53}" };
+        static inline constexpr AZ::Uuid MyAsset4Id{ "{EE99215B-7AB4-4757-B8AF-F78BD4903AC4}" };
+        static inline constexpr AZ::Uuid MyAsset5Id{ "{D9CDAB04-D206-431E-BDC0-1DD615D56197}" };
+        static inline constexpr AZ::Uuid MyAsset6Id{ "{B2F139C3-5032-4B52-ADCA-D52A8F88E043}" };
 
 
         // Initialize the Job Manager with 2 threads for the Asset Manager to use.
         size_t GetNumJobManagerThreads() const override { return 2; }
 
-        static constexpr inline char MyAssetAId[] = "{C5B08D5D-8589-4706-A53F-96248CFDCE73}";
-        static constexpr inline char MyAssetBId[] = "{E1DECFB8-6FAC-4FE4-BD54-3A4A4E6616A5}";
-        static constexpr inline char MyAssetCId[] = "{F7091500-A220-4407-BEF4-B658D8D24289}";
-        static constexpr inline char MyAssetDId[] = "{1BB6CA5B-CE56-497B-B721-9460365E1125}";
+        static constexpr inline AZ::Uuid MyAssetAId{ "{C5B08D5D-8589-4706-A53F-96248CFDCE73}" };
+        static constexpr inline AZ::Uuid MyAssetBId{ "{E1DECFB8-6FAC-4FE4-BD54-3A4A4E6616A5}" };
+        static constexpr inline AZ::Uuid MyAssetCId{ "{F7091500-A220-4407-BEF4-B658D8D24289}" };
+        static constexpr inline AZ::Uuid MyAssetDId{ "{1BB6CA5B-CE56-497B-B721-9460365E1125}" };
 
         void SetupAssets(DataDrivenHandlerAndCatalog* catalog)
         {

+ 2 - 2
Code/Framework/AzCore/Tests/Components.cpp

@@ -51,8 +51,8 @@ TEST(ComponentApplication, Test)
 
     systemEntity->CreateComponent<MemoryComponent>();
     systemEntity->CreateComponent<StreamerComponent>();
-    systemEntity->CreateComponent("{CAE3A025-FAC9-4537-B39E-0A800A2326DF}"); // JobManager component
-    systemEntity->CreateComponent("{D5A73BCC-0098-4d1e-8FE4-C86101E374AC}"); // AssetDatabase component
+    systemEntity->CreateComponent(AZ::Uuid("{CAE3A025-FAC9-4537-B39E-0A800A2326DF}")); // JobManager component
+    systemEntity->CreateComponent(AZ::Uuid("{D5A73BCC-0098-4d1e-8FE4-C86101E374AC}")); // AssetDatabase component
 
     systemEntity->Init();
     systemEntity->Activate();

+ 1 - 1
Code/Framework/AzCore/Tests/EntityTests.cpp

@@ -242,7 +242,7 @@ namespace UnitTest
         // Component overrides
         void Activate() override { }
         void Deactivate() override { }
-        const AZ::TypeId& GetUnderlyingComponentType() const override
+        AZ::TypeId GetUnderlyingComponentType() const override
         {
             if (m_wrappedComponent)
             {

+ 41 - 0
Code/Framework/AzCore/Tests/Rtti.cpp

@@ -116,39 +116,80 @@ namespace UnitTest
         EXPECT_EQ(AZ::Uuid("{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"), azrtti_typeid<const int&&>());
         EXPECT_EQ(AZ::Uuid("{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"), azrtti_typeid<const int>());
 
+        // TypeId aggregation with template ID as prefix
+        // Aggregation uses right fold for addition (Id1 + (Id2 + (Id3 + (... + Idn))))
+        static_assert(azrtti_typeid<int>() + azrtti_typeid<char>() == AZ::Internal::AggregateTypes<int, char>::Uuid());
+        static_assert(azrtti_typeid<AZStd::tuple>() + azrtti_typeid<int>() == azrtti_typeid<AZStd::tuple<int>>());
+        static_assert(azrtti_typeid<AZStd::tuple>() + (azrtti_typeid<int>() + azrtti_typeid<char>()) == azrtti_typeid<AZStd::tuple<int, char>>());
+        static_assert(azrtti_typeid<AZStd::tuple>() + azrtti_typeid<int>() + azrtti_typeid<char>() != azrtti_typeid<AZStd::tuple<int, char>>());
+
+        static_assert(AZ::Uuid("{B2F5707A-08FA-566A-BE44-226C634405BE}") == azrtti_typeid<AZStd::less<int>>());
         EXPECT_EQ(AZ::Uuid("{B2F5707A-08FA-566A-BE44-226C634405BE}"), (azrtti_typeid<AZStd::less<int>>()));
+        static_assert(AZ::Uuid("{6D2500BA-EE64-5288-9766-4C7CD8A10476}") == azrtti_typeid<AZStd::less_equal<int>>());
         EXPECT_EQ(AZ::Uuid("{6D2500BA-EE64-5288-9766-4C7CD8A10476}"), (azrtti_typeid<AZStd::less_equal<int>>()));
+        static_assert(AZ::Uuid("{5959973B-2113-5789-BC8C-2F1E4A917953}") == azrtti_typeid<AZStd::greater<int>>());
         EXPECT_EQ(AZ::Uuid("{5959973B-2113-5789-BC8C-2F1E4A917953}"), (azrtti_typeid<AZStd::greater<int>>()));
+        static_assert(AZ::Uuid("{7769141C-BF97-5E9B-B77F-F075FA915905}") == azrtti_typeid<AZStd::greater_equal<int>>());
         EXPECT_EQ(AZ::Uuid("{7769141C-BF97-5E9B-B77F-F075FA915905}"), (azrtti_typeid<AZStd::greater_equal<int>>()));
+        static_assert(AZ::Uuid("{39487937-0E1C-5F78-8A7E-B24EFE32F48F}") == azrtti_typeid<AZStd::equal_to<int>>());
         EXPECT_EQ(AZ::Uuid("{39487937-0E1C-5F78-8A7E-B24EFE32F48F}"), (azrtti_typeid<AZStd::equal_to<int>>()));
+        static_assert(AZ::Uuid("{AE785799-21A1-5D89-A083-E4441E1F81A8}") == azrtti_typeid<AZStd::hash<int>>());
         EXPECT_EQ(AZ::Uuid("{AE785799-21A1-5D89-A083-E4441E1F81A8}"), (azrtti_typeid<AZStd::hash<int>>()));
+        static_assert(AZ::Uuid("{64503325-ECF4-5F02-95F9-E37D00810E59}") == azrtti_typeid<AZStd::pair<int, int>>());
         EXPECT_EQ(AZ::Uuid("{64503325-ECF4-5F02-95F9-E37D00810E59}"), (azrtti_typeid<AZStd::pair<int, int>>()));
+        static_assert(AZ::Uuid("{853CDD8D-12FF-5619-9A42-10178785620A}") == azrtti_typeid<AZStd::tuple<int, char, float, double>>());
         EXPECT_EQ(AZ::Uuid("{853CDD8D-12FF-5619-9A42-10178785620A}"), (azrtti_typeid<AZStd::tuple<int, char, float, double>>()));
+        static_assert(AZ::Uuid("{85AFA5E8-AA5C-50A3-9CAB-B8C483DA88C5}") == azrtti_typeid<AZStd::vector<int>>());
         EXPECT_EQ(AZ::Uuid("{85AFA5E8-AA5C-50A3-9CAB-B8C483DA88C5}"), (azrtti_typeid<AZStd::vector<int>>()));
+        static_assert(AZ::Uuid("{09C2272F-2353-5337-BDCB-B1D0D6A2A778}") == azrtti_typeid<AZStd::list<int>>());
         EXPECT_EQ(AZ::Uuid("{09C2272F-2353-5337-BDCB-B1D0D6A2A778}"), (azrtti_typeid<AZStd::list<int>>()));
+        static_assert(AZ::Uuid("{2D875DAD-A157-5792-AE25-96D909E1BE4C}") == azrtti_typeid<AZStd::forward_list<int>>());
         EXPECT_EQ(AZ::Uuid("{2D875DAD-A157-5792-AE25-96D909E1BE4C}"), (azrtti_typeid<AZStd::forward_list<int>>()));
+        static_assert(AZ::Uuid("{9DF03CD1-931A-544D-A93B-0546907B70CA}") == azrtti_typeid<AZStd::set<int>>());
         EXPECT_EQ(AZ::Uuid("{9DF03CD1-931A-544D-A93B-0546907B70CA}"), (azrtti_typeid<AZStd::set<int>>()));
+        static_assert(AZ::Uuid("{243A34FA-C6F6-51D1-8166-06DED5141370}") == azrtti_typeid<AZStd::unordered_set<int>>());
         EXPECT_EQ(AZ::Uuid("{243A34FA-C6F6-51D1-8166-06DED5141370}"), (azrtti_typeid<AZStd::unordered_set<int>>()));
+        static_assert(AZ::Uuid("{79F4B21A-02CD-58C1-9669-FA2E5E7A142A}") == azrtti_typeid<AZStd::unordered_multiset<int>>());
         EXPECT_EQ(AZ::Uuid("{79F4B21A-02CD-58C1-9669-FA2E5E7A142A}"), (azrtti_typeid<AZStd::unordered_multiset<int>>()));
+        static_assert(AZ::Uuid("{BB54671F-18E6-5F96-B659-FA236D1B7D31}") == azrtti_typeid<AZStd::map<int, int>>());
         EXPECT_EQ(AZ::Uuid("{BB54671F-18E6-5F96-B659-FA236D1B7D31}"), (azrtti_typeid<AZStd::map<int, int>>()));
+        static_assert(AZ::Uuid("{C543E26A-7772-5511-8CE1-A8FA6441CAD3}") == azrtti_typeid<AZStd::unordered_map<int, int>>());
         EXPECT_EQ(AZ::Uuid("{C543E26A-7772-5511-8CE1-A8FA6441CAD3}"), (azrtti_typeid<AZStd::unordered_map<int, int>>()));
+        static_assert(AZ::Uuid("{FD30FBC0-B826-51CF-A75B-E00466FEB0F0}") == azrtti_typeid<AZStd::unordered_map<AZStd::string, MyClass>>());
         EXPECT_EQ(AZ::Uuid("{FD30FBC0-B826-51CF-A75B-E00466FEB0F0}"), (azrtti_typeid<AZStd::unordered_map<AZStd::string, MyClass>>()));
+        static_assert(AZ::Uuid("{64E53B04-DD49-55DB-8299-5B4ED53A5F1C}") == azrtti_typeid<AZStd::unordered_multimap<int, int>>());
         EXPECT_EQ(AZ::Uuid("{64E53B04-DD49-55DB-8299-5B4ED53A5F1C}"), (azrtti_typeid<AZStd::unordered_multimap<int, int>>()));
+        static_assert(AZ::Uuid("{1C213FE1-ED58-5889-8FC9-48D0E11D2E7E}") == azrtti_typeid<AZStd::unordered_multimap<AZStd::string, MyClass>>());
         EXPECT_EQ(AZ::Uuid("{1C213FE1-ED58-5889-8FC9-48D0E11D2E7E}"), (azrtti_typeid<AZStd::unordered_multimap<AZStd::string, MyClass>>()));
+        static_assert(AZ::Uuid("{0BF83553-00B0-5B7C-9BF3-A87C811F0752}") == azrtti_typeid<AZStd::shared_ptr<int>>());
         EXPECT_EQ(AZ::Uuid("{0BF83553-00B0-5B7C-9BF3-A87C811F0752}"), (azrtti_typeid<AZStd::shared_ptr<int>>()));
+        static_assert(AZ::Uuid("{E91D2018-767D-57D4-AF21-5CBEA51A15EC}") == azrtti_typeid<AZStd::optional<int>>());
         EXPECT_EQ(AZ::Uuid("{E91D2018-767D-57D4-AF21-5CBEA51A15EC}"), (azrtti_typeid<AZStd::optional<int>>()));
+        static_assert(AZ::Uuid("{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}") == azrtti_typeid<AZStd::basic_string<char>>());
         EXPECT_EQ(AZ::Uuid("{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"), (azrtti_typeid<AZStd::basic_string<char>>()));
+        static_assert(AZ::Uuid("{406E9B16-A89C-5289-B10E-17F338588559}") == azrtti_typeid<AZStd::char_traits<char>>());
         EXPECT_EQ(AZ::Uuid("{406E9B16-A89C-5289-B10E-17F338588559}"), (azrtti_typeid<AZStd::char_traits<char>>()));
+        static_assert(AZ::Uuid("{7114E998-A8B4-519B-9342-A86D1587B4F7}") == azrtti_typeid<AZStd::basic_string_view<char>>());
         EXPECT_EQ(AZ::Uuid("{7114E998-A8B4-519B-9342-A86D1587B4F7}"), (azrtti_typeid<AZStd::basic_string_view<char>>()));
 
+        static_assert(AZ::Uuid("E95DF2A0-D136-5E86-9CF7-9C806786DC39") == azrtti_typeid<AZStd::fixed_string< 4>>());
         EXPECT_EQ(AZ::Uuid("{A3C35B6E-E2DE-58F7-A897-06C64C5BC1E3}"), (azrtti_typeid<AZStd::fixed_vector<int, 4>>()));
+        static_assert(AZ::Uuid("{A3C35B6E-E2DE-58F7-A897-06C64C5BC1E3}") == azrtti_typeid<AZStd::fixed_vector<int, 4>>());
+        EXPECT_EQ(AZ::Uuid("{A3C35B6E-E2DE-58F7-A897-06C64C5BC1E3}"), (azrtti_typeid<AZStd::fixed_vector<int, 4>>()));
+        static_assert(AZ::Uuid("{F670463F-FB3F-5CF3-A1FE-A7CC6DB312E8}") == azrtti_typeid<AZStd::fixed_list<int, 4>>());
         EXPECT_EQ(AZ::Uuid("{F670463F-FB3F-5CF3-A1FE-A7CC6DB312E8}"), (azrtti_typeid<AZStd::fixed_list<int, 4>>()));
+        static_assert(AZ::Uuid("{71C90433-74CE-5018-BEFD-FC98F4451AEF}") == azrtti_typeid<AZStd::fixed_forward_list<int, 4>>());
         EXPECT_EQ(AZ::Uuid("{71C90433-74CE-5018-BEFD-FC98F4451AEF}"), (azrtti_typeid<AZStd::fixed_forward_list<int, 4>>()));
+        static_assert(AZ::Uuid("{DD9565F2-A80F-5DD3-B33F-0B0BF1C24A4F}") == azrtti_typeid<AZStd::array<int, 4>>());
         EXPECT_EQ(AZ::Uuid("{DD9565F2-A80F-5DD3-B33F-0B0BF1C24A4F}"), (azrtti_typeid<AZStd::array<int, 4>>()));
+        static_assert(AZ::Uuid("{E5848517-FBDC-5D0F-9012-B16951027D9E}") == azrtti_typeid<AZStd::bitset<8>>());
         EXPECT_EQ(AZ::Uuid("{E5848517-FBDC-5D0F-9012-B16951027D9E}"), (azrtti_typeid<AZStd::bitset<8>>()));
+        static_assert(AZ::Uuid("{537AD6E8-7443-5C1F-97FD-9284C41C13A4}") == azrtti_typeid<AZStd::function<bool(int)>>());
         EXPECT_EQ(AZ::Uuid("{537AD6E8-7443-5C1F-97FD-9284C41C13A4}"), (azrtti_typeid<AZStd::function<bool(int)>>()));
 
+        static_assert(AZ::Uuid("{B1E9136B-D77A-4643-BE8E-2ABDA246AE0E}") == azrtti_typeid<AZStd::monostate>());
         EXPECT_EQ(AZ::Uuid("{B1E9136B-D77A-4643-BE8E-2ABDA246AE0E}"), (azrtti_typeid<AZStd::monostate>()));
+        static_assert(AZ::Uuid("{7570E0E7-0BA8-5382-BB14-CEB7B1C0DBEB}") == azrtti_typeid<AZStd::variant<int, char>>());
         EXPECT_EQ(AZ::Uuid("{7570E0E7-0BA8-5382-BB14-CEB7B1C0DBEB}"), (azrtti_typeid<AZStd::variant<int, char>>()));
     }
 

+ 14 - 14
Code/Framework/AzCore/Tests/Serialization.cpp

@@ -1152,18 +1152,18 @@ namespace AZ {
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<GenericClass>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<GenericClass>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
@@ -1181,7 +1181,7 @@ namespace AZ {
             return static_cast<ClassInfoType*>(GetCurrentSerializeContextModule().CreateGenericClassInfo<GenericClass>());
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -1216,18 +1216,18 @@ namespace AZ {
                 return 1;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<GenericClass>::GetClassTypeId();
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return azrtti_typeid<GenericChild>();
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return TYPEINFO_Uuid();
             }
@@ -1245,7 +1245,7 @@ namespace AZ {
             return static_cast<ClassInfoType*>(GetCurrentSerializeContextModule().CreateGenericClassInfo<GenericChild>());
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }
@@ -2267,7 +2267,7 @@ TEST_F(SerializeBasicTest, BasicTypeTest_Succeed)
             return classElement.Convert<SimpleDerivedClass2>(context);
         };
 
-        sc.ClassDeprecate("SimpleDerivedClass1", "{78632262-C303-49BC-ABAD-88B088098311}", converter);
+        sc.ClassDeprecate("SimpleDerivedClass1", AZ::Uuid("{78632262-C303-49BC-ABAD-88B088098311}"), converter);
 
         auto cb = [](void* classPtr, const Uuid& classId, SerializeContext* /*context*/) -> void
         {
@@ -2426,7 +2426,7 @@ TEST_F(SerializeBasicTest, BasicTypeTest_Succeed)
                     // Test deprecation with one member class marked as deprecated
                     {
                         SerializeContext sc;
-                        sc.ClassDeprecate("DeprecatedClass", "{893CA46E-6D1A-4D27-94F7-09E26DE5AE4B}");
+                        sc.ClassDeprecate("DeprecatedClass", AZ::Uuid("{893CA46E-6D1A-4D27-94F7-09E26DE5AE4B}"));
                         sc.Class<DeprecationTestClass>()
                             ->Version(2)
                             ->Field("m_deprecated", &DeprecationTestClass::m_deprecated)
@@ -2469,7 +2469,7 @@ TEST_F(SerializeBasicTest, BasicTypeTest_Succeed)
                             return classElement.Convert<DeprecationTestClass>(context);
                         };
 
-                        sc.ClassDeprecate("DeprecatedClass", "{893CA46E-6D1A-4D27-94F7-09E26DE5AE4B}", converter);
+                        sc.ClassDeprecate("DeprecatedClass", AZ::Uuid("{893CA46E-6D1A-4D27-94F7-09E26DE5AE4B}"), converter);
 
                         // XML
                         AZ_TracePrintf("SerializeDeprecationTest", "Loading XML with deprecated class\n");
@@ -2655,7 +2655,7 @@ TEST_F(SerializeBasicTest, BasicTypeTest_Succeed)
                     // Test deprecation
                     {
                         SerializeContext sc;
-                        sc.ClassDeprecate("DeprecatedClass", "{893CA46E-6D1A-4D27-94F7-09E26DE5AE4B}");
+                        sc.ClassDeprecate("DeprecatedClass", AZ::Uuid("{893CA46E-6D1A-4D27-94F7-09E26DE5AE4B}"));
 
                         ObjectStream::ClassReadyCB readyCB(AZStd::bind(&DeprecationTest::CheckDeprecated, this, AZStd::placeholders::_1, AZStd::placeholders::_2));
 
@@ -6466,7 +6466,7 @@ namespace UnitTest
             ->Field("m_value", &AggregateTestClassV2::m_value)
             ;
 
-        m_serializeContext->ClassDeprecate("EmptyDeprecatedClass", "{73890A64-9ADB-4639-B0E0-93294CE81B19}",
+        m_serializeContext->ClassDeprecate("EmptyDeprecatedClass", AZ::Uuid("{73890A64-9ADB-4639-B0E0-93294CE81B19}"),
             [](AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& rootElementNode) -> bool
         {
             rootElementNode.Convert<ConvertedNewClass>(context);
@@ -6482,7 +6482,7 @@ namespace UnitTest
         m_serializeContext->EnableRemoveReflection();
         m_serializeContext->Class<ConvertedNewClass>();
         m_serializeContext->Class<AggregateTestClassV2>();
-        m_serializeContext->ClassDeprecate("EmptyDeprecatedClass", "{73890A64-9ADB-4639-B0E0-93294CE81B19}",
+        m_serializeContext->ClassDeprecate("EmptyDeprecatedClass", AZ::Uuid("{73890A64-9ADB-4639-B0E0-93294CE81B19}"),
             [](AZ::SerializeContext&, AZ::SerializeContext::DataElementNode&) -> bool
         {
             return true;

+ 5 - 5
Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp

@@ -24,7 +24,7 @@ namespace AZ
         public:
             GenericTemplatedClassInfo()
                 : m_classData{ SerializeContext::ClassData::Create<ThisType>(
-                      "TemplatedClass", "{CA4ADF74-66E7-4D16-B4AC-F71278C60EC7}", nullptr, nullptr) }
+                      "TemplatedClass", AZ::TypeId("{CA4ADF74-66E7-4D16-B4AC-F71278C60EC7}"), nullptr, nullptr) }
             {
             }
 
@@ -38,17 +38,17 @@ namespace AZ
                 return 1;
             }
 
-            const Uuid& GetSpecializedTypeId() const override
+            AZ::TypeId GetSpecializedTypeId() const override
             {
                 return m_classData.m_typeId;
             }
 
-            const Uuid& GetGenericTypeId() const override
+            AZ::TypeId GetGenericTypeId() const override
             {
                 return m_classData.m_typeId;
             }
 
-            const Uuid& GetTemplatedTypeId(size_t element) override
+            AZ::TypeId GetTemplatedTypeId(size_t element) override
             {
                 (void)element;
                 return SerializeGenericTypeInfo<T>::GetClassTypeId();
@@ -75,7 +75,7 @@ namespace AZ
             return GetCurrentSerializeContextModule().CreateGenericClassInfo<ThisType>();
         }
 
-        static const Uuid& GetClassTypeId()
+        static AZ::TypeId GetClassTypeId()
         {
             return GetGenericInfo()->GetClassData()->m_typeId;
         }

+ 1 - 0
Code/Framework/AzCore/Tests/Time/TimeTests.cpp

@@ -6,6 +6,7 @@
  *
  */
 
+#include <AzCore/Math/MathUtils.h>
 #include <AzCore/Time/TimeSystem.h>
 #include <AzCore/UnitTest/TestTypes.h>
 

+ 159 - 106
Code/Framework/AzCore/Tests/UUIDTests.cpp

@@ -9,7 +9,6 @@
 #include <AzCore/Math/Uuid.h>
 #include <AzCore/std/containers/unordered_set.h>
 
-using namespace AZ;
 
 namespace UnitTest
 {
@@ -17,13 +16,13 @@ namespace UnitTest
         : public UnitTest::AllocatorsTestFixture
     {
         static const int numUuid = 2000;
-        Uuid* m_array;
+        AZ::Uuid* m_array;
     public:
         void SetUp() override
         {
             AllocatorsTestFixture::SetUp();
 
-            m_array = (Uuid*)azmalloc(sizeof(Uuid) * numUuid, AZStd::alignment_of<Uuid>::value);
+            m_array = (AZ::Uuid*)azmalloc(sizeof(AZ::Uuid) * numUuid, alignof(AZ::Uuid));
         }
         void TearDown() override
         {
@@ -33,27 +32,11 @@ namespace UnitTest
         }
         void run()
         {
-            Uuid defId;
-            defId.data[0] = 0xb5;
-            defId.data[1] = 0x70;
-            defId.data[2] = 0x0f;
-            defId.data[3] = 0x2e;
-            defId.data[4] = 0x66;
-            defId.data[5] = 0x1b;
-            defId.data[6] = 0x4a;
-            defId.data[7] = 0xc0;
-            defId.data[8] = 0x93;
-            defId.data[9] = 0x35;
-            defId.data[10] = 0x81;
-            defId.data[11] = 0x7c;
-            defId.data[12] = 0xb4;
-            defId.data[13] = 0xc0;
-            defId.data[14] = 0x9c;
-            defId.data[15] = 0xcb;
+            AZ::Uuid defId("{B5700F2E-661B-4AC0-9335-817CB4C09CCB}");
 
             // null
-            Uuid id = Uuid::CreateNull();
-            AZ_TEST_ASSERT(id.IsNull());
+            AZ::Uuid id;
+            EXPECT_TRUE(id.IsNull());
 
             const char idStr1[] = "{B5700F2E-661B-4AC0-9335-817CB4C09CCB}";
             const char idStr2[] = "{B5700F2E661B4AC09335817CB4C09CCB}";
@@ -61,87 +44,87 @@ namespace UnitTest
             const char idStr4[] = "B5700F2E661B4AC09335817CB4C09CCB";
 
             // create from string
-            id = Uuid::CreateString(idStr1);
-            AZ_TEST_ASSERT(id == defId);
-            id = Uuid::CreateString(idStr2);
-            AZ_TEST_ASSERT(id == defId);
-            id = Uuid::CreateString(idStr3);
-            AZ_TEST_ASSERT(id == defId);
-            id = Uuid::CreateString(idStr4);
-            AZ_TEST_ASSERT(id == defId);
+            id = AZ::Uuid::CreateString(idStr1);
+            EXPECT_EQ(defId, id);
+            id = AZ::Uuid::CreateString(idStr2);
+            EXPECT_EQ(defId, id);
+            id = AZ::Uuid::CreateString(idStr3);
+            EXPECT_EQ(defId, id);
+            id = AZ::Uuid::CreateString(idStr4);
+            EXPECT_EQ(defId, id);
 
             // variant
-            AZ_TEST_ASSERT(id.GetVariant() == Uuid::VAR_RFC_4122);
+            EXPECT_EQ(AZ::Uuid::VAR_RFC_4122, id.GetVariant());
             // version
-            AZ_TEST_ASSERT(id.GetVersion() == Uuid::VER_RANDOM);
+            EXPECT_EQ(AZ::Uuid::VER_RANDOM, id.GetVersion());
 
             // tostring
             char buffer[39];
-            id = Uuid::CreateString(idStr1);
-            AZ_TEST_ASSERT(id.ToString(buffer, 39, true, true) == 39);
-            AZ_TEST_ASSERT(strcmp(buffer, idStr1) == 0);
-            AZ_TEST_ASSERT(id.ToString(buffer, 35, true, false) == 35);
-            AZ_TEST_ASSERT(strcmp(buffer, idStr2) == 0);
-            AZ_TEST_ASSERT(id.ToString(buffer, 37, false, true) == 37);
-            AZ_TEST_ASSERT(strcmp(buffer, idStr3) == 0);
-            AZ_TEST_ASSERT(id.ToString(buffer, 33, false, false) == 33);
-            AZ_TEST_ASSERT(strcmp(buffer, idStr4) == 0);
-
-            AZ_TEST_ASSERT(id.ToString<AZStd::string>() == AZStd::string(idStr1));
-            AZ_TEST_ASSERT(id.ToString<AZStd::string>(true, false) == AZStd::string(idStr2));
-            AZ_TEST_ASSERT(id.ToString<AZStd::string>(false, true) == AZStd::string(idStr3));
-            AZ_TEST_ASSERT(id.ToString<AZStd::string>(false, false) == AZStd::string(idStr4));
+            id = AZ::Uuid::CreateString(idStr1);
+            EXPECT_EQ(39, id.ToString(buffer, 39, true, true));
+            EXPECT_EQ(0, strcmp(buffer, idStr1));
+            EXPECT_EQ(35, id.ToString(buffer, 35, true, false));
+            EXPECT_EQ(0, strcmp(buffer, idStr2));
+            EXPECT_EQ(37, id.ToString(buffer, 37, false, true));
+            EXPECT_EQ(0, strcmp(buffer, idStr3));
+            EXPECT_EQ(33, id.ToString(buffer, 33, false, false));
+            EXPECT_EQ(0, strcmp(buffer, idStr4));
+
+            EXPECT_EQ(AZStd::string(idStr1), id.ToString<AZStd::string>());
+            EXPECT_EQ(AZStd::string(idStr2), id.ToString<AZStd::string>(true, false));
+            EXPECT_EQ(AZStd::string(idStr3), id.ToString<AZStd::string>(false, true));
+            EXPECT_EQ(AZStd::string(idStr4), id.ToString<AZStd::string>(false, false));
 
             AZStd::string str1;
             id.ToString(str1);
-            AZ_TEST_ASSERT(str1 == AZStd::string(idStr1));
+            EXPECT_EQ(AZStd::string(idStr1), str1);
             id.ToString(str1, true, false);
-            AZ_TEST_ASSERT(str1 == AZStd::string(idStr2));
+            EXPECT_EQ(AZStd::string(idStr2), str1);
             id.ToString(str1, false, true);
-            AZ_TEST_ASSERT(str1 == AZStd::string(idStr3));
+            EXPECT_EQ(AZStd::string(idStr3), str1);
             id.ToString(str1, false, false);
-            AZ_TEST_ASSERT(str1 == AZStd::string(idStr4));
+            EXPECT_EQ(AZStd::string(idStr4), str1);
 
             // operators
-            Uuid idBigger("C5700F2E661B4ac09335817CB4C09CCB");
-            AZ_TEST_ASSERT(id < idBigger);
-            AZ_TEST_ASSERT(id != idBigger);
-            AZ_TEST_ASSERT(idBigger > id);
+            AZ::Uuid idBigger("C5700F2E661B4ac09335817CB4C09CCB");
+            EXPECT_LT(id, idBigger);
+            EXPECT_NE(idBigger, id);
+            EXPECT_GT(idBigger,id);
 
             // hash
             AZStd::hash<AZ::Uuid> hash;
             size_t hashVal = hash(id);
-            AZ_TEST_ASSERT(hashVal != 0);
+            EXPECT_NE(0, hashVal);
 
             // test the hashing and equal function in a unordered container
-            typedef AZStd::unordered_set<AZ::Uuid> UuidSetType;
+            using UuidSetType = AZStd::unordered_set<AZ::Uuid>;
             UuidSetType uuidSet;
             uuidSet.insert(id);
-            AZ_TEST_ASSERT(uuidSet.find(id) != uuidSet.end());
+            EXPECT_NE(uuidSet.end(), uuidSet.find(id));
 
             // check uniqueness (very quick and basic)
             for (int i = 0; i < numUuid; ++i)
             {
-                m_array[i] = Uuid::Create();
+                m_array[i] = AZ::Uuid::Create();
             }
 
             for (int i = 0; i < numUuid; ++i)
             {
-                Uuid uniqueToTest = Uuid::Create();
+                auto uniqueToTest = AZ::Uuid::Create();
                 for (int j = 0; j < numUuid; ++j)
                 {
-                    AZ_TEST_ASSERT(m_array[j] != uniqueToTest);
+                    EXPECT_NE(uniqueToTest, m_array[j]);
                 }
             }
 
             // test the name function
-            Uuid uuidName = Uuid::CreateName("BlaBla");
+            auto uuidName = AZ::Uuid::CreateName("BlaBla");
             // check variant
-            AZ_TEST_ASSERT(uuidName.GetVariant() == Uuid::VAR_RFC_4122);
+            EXPECT_EQ(AZ::Uuid::VAR_RFC_4122, uuidName.GetVariant());
             // check version
-            AZ_TEST_ASSERT(uuidName.GetVersion() == Uuid::VER_NAME_SHA1);
+            EXPECT_EQ(AZ::Uuid::VER_NAME_SHA1, uuidName.GetVersion());
             // check id
-            AZ_TEST_ASSERT(uuidName == Uuid::CreateName("BlaBla"));
+            EXPECT_EQ(AZ::Uuid::CreateName("BlaBla"), uuidName);
         }
     };
 
@@ -154,107 +137,107 @@ namespace UnitTest
     {
         const char leftStr[] = "{F418022E-DAFE-4450-BCB9-4B7727070178}";
         const char rightStr[] = "{B5700F2E-661B-4AC0-9335-817CB4C09CCB}";
-        Uuid left = Uuid::CreateString(leftStr);
-        Uuid right = Uuid::CreateString(rightStr);
-        EXPECT_TRUE(left >= right);
+        AZ::Uuid left = AZ::Uuid::CreateString(leftStr);
+        AZ::Uuid right = AZ::Uuid::CreateString(rightStr);
+        EXPECT_GE(left, right);
     }
 
-    TEST_F(UuidTests, GreaterThanOrEqualTo_LeftLessThanRight_ReturnsFalse)
+    TEST_F(UuidTests, LessThan_LeftLessThanRight_ReturnsTrue)
     {
         const char leftStr[] = "{A418022E-DAFE-4450-BCB9-4B7727070178}";
         const char rightStr[] = "{B5700F2E-661B-4AC0-9335-817CB4C09CCB}";
-        Uuid left = Uuid::CreateString(leftStr);
-        Uuid right = Uuid::CreateString(rightStr);
-        EXPECT_FALSE(left >= right);
+        AZ::Uuid left = AZ::Uuid::CreateString(leftStr);
+        AZ::Uuid right = AZ::Uuid::CreateString(rightStr);
+        EXPECT_LT(left, right);
     }
 
     TEST_F(UuidTests, GreaterThanOrEqualTo_LeftEqualsRight_ReturnsTrue)
     {
         const char uuidStr[] = "{F418022E-DAFE-4450-BCB9-4B7727070178}";
-        Uuid left = Uuid::CreateString(uuidStr);
-        Uuid right = Uuid::CreateString(uuidStr);
-        EXPECT_TRUE(left >= right);
+        AZ::Uuid left = AZ::Uuid::CreateString(uuidStr);
+        AZ::Uuid right = AZ::Uuid::CreateString(uuidStr);
+        EXPECT_GE(left, right);
     }
 
-    TEST_F(UuidTests, LessThanOrEqualTo_LeftGreaterThanRight_ReturnsFalse)
+    TEST_F(UuidTests, GreaterThan_LeftGreaterThanRight_ReturnsTrue)
     {
         const char leftStr[] = "{F418022E-DAFE-4450-BCB9-4B7727070178}";
         const char rightStr[] = "{B5700F2E-661B-4AC0-9335-817CB4C09CCB}";
-        Uuid left = Uuid::CreateString(leftStr);
-        Uuid right = Uuid::CreateString(rightStr);
-        EXPECT_FALSE(left <= right);
+        AZ::Uuid left = AZ::Uuid::CreateString(leftStr);
+        AZ::Uuid right = AZ::Uuid::CreateString(rightStr);
+        EXPECT_GT(left, right);
     }
 
     TEST_F(UuidTests, LessThanOrEqualTo_LeftLessThanRight_ReturnsTrue)
     {
         const char leftStr[] = "{A418022E-DAFE-4450-BCB9-4B7727070178}";
         const char rightStr[] = "{B5700F2E-661B-4AC0-9335-817CB4C09CCB}";
-        Uuid left = Uuid::CreateString(leftStr);
-        Uuid right = Uuid::CreateString(rightStr);
-        EXPECT_TRUE(left <= right);
+        AZ::Uuid left = AZ::Uuid::CreateString(leftStr);
+        AZ::Uuid right = AZ::Uuid::CreateString(rightStr);
+        EXPECT_LE(left, right);
     }
 
     TEST_F(UuidTests, LessThanOrEqualTo_LeftEqualsRight_ReturnsTrue)
     {
         const char uuidStr[] = "{F418022E-DAFE-4450-BCB9-4B7727070178}";
-        Uuid left = Uuid::CreateString(uuidStr);
-        Uuid right = Uuid::CreateString(uuidStr);
-        EXPECT_TRUE(left <= right);
+        AZ::Uuid left = AZ::Uuid::CreateString(uuidStr);
+        AZ::Uuid right = AZ::Uuid::CreateString(uuidStr);
+        EXPECT_LE(left, right);
     }
 
     TEST_F(UuidTests, CreateStringPermissive_HexAndSpacesGiven_Success)
     {
         const char uuidStr[] = "{34D44249-E599-4B30-811F-4215C2DEA269}";
-        Uuid left = Uuid::CreateString(uuidStr);
+        AZ::Uuid left = AZ::Uuid::CreateString(uuidStr);
 
         const char permissiveStr[] = "{ 0x34D44249 - 0xE5994B30 - 0x811F4215 - 0xC2DEA269 }";
-        Uuid right = Uuid::CreateStringPermissive(permissiveStr);
+        AZ::Uuid right = AZ::Uuid::CreateStringPermissive(permissiveStr);
         EXPECT_EQ(left, right);
 
         const char permissiveStr2[] = "{ 0x34D44249-0xE5994B30  0x811F4215 - C2DEA269 }";
-        right = Uuid::CreateStringPermissive(permissiveStr2);
+        right = AZ::Uuid::CreateStringPermissive(permissiveStr2);
         EXPECT_EQ(left, right);
 
         const char permissiveStr3[] = "34D44249-0xE5994B30  0x811F4215 - C2DEA269 }";
-        right = Uuid::CreateStringPermissive(permissiveStr3);
+        right = AZ::Uuid::CreateStringPermissive(permissiveStr3);
         EXPECT_EQ(left, right);
 
         const char permissiveStr4[] = "{ x34D44249 - xE5994B30 - x811F4215  xC2DEA269 }";
-        right = Uuid::CreateStringPermissive(permissiveStr4);
+        right = AZ::Uuid::CreateStringPermissive(permissiveStr4);
         EXPECT_EQ(left, right);
 
         const char permissiveStr5[] = "{ 0X34D44249 - 0XE5994B30 - 0X811F4215  0XC2DEA269 }";
-        right = Uuid::CreateStringPermissive(permissiveStr5);
+        right = AZ::Uuid::CreateStringPermissive(permissiveStr5);
         EXPECT_EQ(left, right);
     }
 
     TEST_F(UuidTests, CreateStringPermissive_InvalidHexAndSpacesGiven_Fails)
     {
         const char uuidStr[] = "{8FDDE7B1 - C332 - 4EBA - BD85 - 2898E7440E4C}";
-        Uuid left = Uuid::CreateStringPermissive(uuidStr);
+        AZ::Uuid left = AZ::Uuid::CreateStringPermissive(uuidStr);
 
         const char permissiveStr1[] = "{ 8FDDE7B1 - 0 xC332 - 4EBA - BD85 - 2898E7440E4C}";
-        Uuid right = Uuid::CreateStringPermissive(permissiveStr1);
+        AZ::Uuid right = AZ::Uuid::CreateStringPermissive(permissiveStr1);
         EXPECT_NE(left, right);
     }
 
     TEST_F(UuidTests, CreateStringPermissive_InvalidCharacterGiven_Fails)
     {
-        Uuid left = Uuid::CreateNull();
+        AZ::Uuid left = AZ::Uuid::CreateNull();
 
         // The below check should just give an empty uuid due to the 'g' 
         const char permissiveStr1[] = "{CCF8AB1E- gA04A-43D1-AD8A-70725BC3392E}";
-        Uuid right = Uuid::CreateStringPermissive(permissiveStr1);
+        AZ::Uuid right = AZ::Uuid::CreateStringPermissive(permissiveStr1);
         EXPECT_EQ(left, right);
     }
 
     TEST_F(UuidTests, CreateStringPermissive_StringWithExtraData_Succeeds)
     {
         const char uuidStr[] = "{34D44249-E599-4B30-811F-4215C2DEA269}";
-        Uuid left = Uuid::CreateString(uuidStr);
+        AZ::Uuid left = AZ::Uuid::CreateString(uuidStr);
 
         const char permissiveStr[] = "0x34D44249-0xE5994B30-0x811F4215-0xC2DEA269 Hello World";
-        Uuid right = Uuid::CreateStringPermissive(permissiveStr);
+        AZ::Uuid right = AZ::Uuid::CreateStringPermissive(permissiveStr);
         EXPECT_EQ(left, right);
 
     }
@@ -262,12 +245,12 @@ namespace UnitTest
     TEST_F(UuidTests, CreateStringPermissive_StringWithLotsOfExtraData_Succeeds)
     {
         const char uuidStr[] = "{34D44249-E599-4B30-811F-4215C2DEA269}";
-        Uuid left = Uuid::CreateString(uuidStr);
+        AZ::Uuid left = AZ::Uuid::CreateString(uuidStr);
 
         const char permissiveStr[] = "0x34D44249-0xE5994B30-0x811F4215-0xC2DEA269 Hello World this is a really long string "
-        "with lots of extra data to make sure we can parse a long string without failing as long as the uuid is in "
-        "the beginning of the string then we should succeed";
-        Uuid right = Uuid::CreateStringPermissive(permissiveStr);
+            "with lots of extra data to make sure we can parse a long string without failing as long as the uuid is in "
+            "the beginning of the string then we should succeed";
+        AZ::Uuid right = AZ::Uuid::CreateStringPermissive(permissiveStr);
         EXPECT_EQ(left, right);
     }
 
@@ -275,17 +258,17 @@ namespace UnitTest
     {
         {
             const char uuidStr[] = "{34D44249-E599-4B30-811F-4215C2DEA269}";
-            const Uuid source = Uuid::CreateString(uuidStr);
+            const AZ::Uuid source = AZ::Uuid::CreateString(uuidStr);
             const AZStd::string dynamic = source.ToString<AZStd::string>();
-            const Uuid::FixedString fixed = source.ToFixedString();
+            const AZ::Uuid::FixedString fixed = source.ToFixedString();
             EXPECT_STREQ(dynamic.c_str(), fixed.c_str());
         }
 
         {
             const char uuidStr[] = "{678EFGBA-E599-4B30-811F-77775555AAFF}";
-            const Uuid source = Uuid::CreateString(uuidStr);
+            const AZ::Uuid source = AZ::Uuid::CreateString(uuidStr);
             const AZStd::string dynamic = source.ToString<AZStd::string>();
-            const Uuid::FixedString fixed = source.ToFixedString();
+            const AZ::Uuid::FixedString fixed = source.ToFixedString();
             EXPECT_STREQ(dynamic.c_str(), fixed.c_str());
         }
     }
@@ -294,7 +277,7 @@ namespace UnitTest
     {
         {
             const char uuidStr[] = "{34D44249-E599-4B30-811F-4215C2DEA269}";
-            const Uuid source = Uuid::CreateString(uuidStr);
+            const AZ::Uuid source = AZ::Uuid::CreateString(uuidStr);
             const AZStd::string dynamic = AZStd::string::format("%s", source.ToString<AZStd::string>().c_str());
             const AZStd::string fixed = AZStd::string::format("%s", source.ToFixedString().c_str());
             EXPECT_EQ(dynamic, fixed);
@@ -302,10 +285,80 @@ namespace UnitTest
 
         {
             const char uuidStr[] = "{678EFGBA-E599-4B30-811F-77775555AAFF}";
-            const Uuid source = Uuid::CreateString(uuidStr);
+            const AZ::Uuid source = AZ::Uuid::CreateString(uuidStr);
             const AZStd::string dynamic = AZStd::string::format("%s", source.ToString<AZStd::string>().c_str());
             const AZStd::string fixed = AZStd::string::format("%s", source.ToFixedString().c_str());
             EXPECT_EQ(dynamic, fixed);
         }
     }
+
+    TEST_F(UuidTests, UuidIsConstexpr_Compiles)
+    {
+        constexpr AZ::Uuid defaultUuid;
+        static_assert(defaultUuid.IsNull());
+        static_assert(defaultUuid == AZ::Uuid{});
+        static_assert(defaultUuid <= AZ::Uuid{});
+        static_assert(defaultUuid >= AZ::Uuid{});
+        static_assert(!(defaultUuid != AZ::Uuid{}));
+        static_assert(!(defaultUuid < AZ::Uuid{}));
+        static_assert(!(defaultUuid > AZ::Uuid{}));
+
+        constexpr AZ::Uuid::FixedString uuidString = defaultUuid.ToFixedString();
+        static_assert(uuidString == "{00000000-0000-0000-0000-000000000000}");
+        EXPECT_EQ("{00000000-0000-0000-0000-000000000000}", uuidString);
+
+        constexpr auto nullUuid = AZ::Uuid::CreateNull();
+        static_assert(nullUuid.IsNull());
+
+        // Uuid from uuid formatted string
+        constexpr AZ::Uuid stringUuid{ "{610014D7-DC11-4305-83D8-D59F3AB224B4}" };
+        static_assert(!stringUuid.IsNull());
+        static_assert(stringUuid != defaultUuid);
+        constexpr AZStd::string_view viewString{ "{610014D7-DC11-4305-83D8-D59F3AB224B4}" };
+        constexpr auto string2Uuid = AZ::Uuid::CreateString(viewString.data(), viewString.size());
+        static_assert(stringUuid == string2Uuid);
+
+
+        // Uuid from text string using SHA-1 algorithm
+        constexpr auto nameUuid = AZ::Uuid::CreateName("BlaBla");
+        // check variant
+        static_assert(nameUuid.GetVariant() == AZ::Uuid::VAR_RFC_4122);
+        // check version
+        static_assert(nameUuid.GetVersion() == AZ::Uuid::VER_NAME_SHA1);
+        // check id
+        static_assert(!nameUuid.IsNull());
+
+        // Uuid from data blob
+        constexpr AZStd::array dataArray{ 0x14, 0x56, 0x32, 0xFF, 0x42, 0x98, 0x76, 0x4d, 0x22, 0xFA };
+        constexpr auto dataUuid = AZ::Uuid::CreateData(dataArray);
+        static_assert(!dataUuid.IsNull());
+
+        // constexpr hash function
+        constexpr AZ::Uuid hashStringUuid{ "{1F02F63B-4527-4234-9D2A-AD11F4323019}" };
+        // The Uuid::GetHash function returns the first 8 bytes of the Uuid as a size_t
+        constexpr size_t expectedHashValue = 0x3442'2745'3BF6'021F;
+        static_assert(hashStringUuid.GetHash() == expectedHashValue);
+    }
+
+    namespace UuidTestInternal
+    {
+        template<auto TypeId>
+        constexpr const char* TypeConverter()
+        {
+            return "Primary Converter";
+        }
+        template<>
+        constexpr const char* TypeConverter<O3DE_UUID_TO_NONTYPE_PARAM("{2232CEF3-A4EF-481D-97AC-90044DAD7FBE}")>()
+        {
+            return "My Custom Converter";
+        }
+    }
+
+    TEST_F(UuidTests, UuidNonTypeSpecialization_IsCalled)
+    {
+        constexpr AZ::Uuid uuidNonSpecialized{ "{EE90E096-00FD-498F-9132-AD963C2AA65D}" };
+        constexpr AZ::Uuid uuidSpecialized{ "{2232CEF3-A4EF-481D-97AC-90044DAD7FBE}" };
+        EXPECT_STREQ("Primary Converter", UuidTestInternal::TypeConverter<O3DE_UUID_TO_NONTYPE_PARAM(uuidNonSpecialized)>());
+        EXPECT_STREQ("My Custom Converter", UuidTestInternal::TypeConverter<O3DE_UUID_TO_NONTYPE_PARAM(uuidSpecialized)>());
+    }
 }

+ 12 - 23
Code/Framework/AzFramework/AzFramework/Asset/AssetRegistry.cpp

@@ -14,42 +14,31 @@
 
 namespace AssetRegistryInternal
 {
-    // to prevent people from shooting themselves in the foot here we are going to normalize the path.
+    // normalize the path.
     // since sha1 is sensitive to both slash direction and case!
     // note that this is not generating asset IDs, its merely creating UUIDs that map from
     // asset path -> asset Id, so that storing asset path as strings is not necessary.
-    AZ::Uuid CreateUUIDForName(const char* name)
+    AZ::Uuid CreateUUIDForName(AZStd::string_view name)
     {
-        if (!name)
+        if (name.empty())
         {
-            return AZ::Uuid::CreateNull();
+            return {};
         }
-
-        // avoid allocating memory.  Note that the input paths are expected to be relative paths
-        // from the root and thus should be much shorter than AZ_MAX_PATH_LEN
-        char tempBuffer[AZ_MAX_PATH_LEN] = { 0 };
-        tempBuffer[AZ_ARRAY_SIZE(tempBuffer) - 1] = 0;
         
-        // here we try to pass over the memory only once.
-        for (AZStd::size_t pos = 0; pos < AZ_ARRAY_SIZE(tempBuffer) - 1; ++pos)
+        // pass over the memory only once
+        auto TransformPath = [](const char elem) -> char
         {
-            char currentValue = name[pos];
-            if (!currentValue)
-            {
-                tempBuffer[pos] = 0;
-                break;
-            }
-            else if (currentValue == '\\')
+            if (elem == AZ::IO::WindowsPathSeparator)
             {
-                tempBuffer[pos] = '/';
+                return AZ::IO::PosixPathSeparator;
             }
             else
             {
-                tempBuffer[pos] = (char)tolower(currentValue);
+                return AZStd::tolower(elem);
             }
-        }
+        };
 
-        return AZ::Uuid::CreateName(tempBuffer);
+        return AZ::Uuid::CreateData(name | AZStd::views::transform(TransformPath));
     }
 }
 
@@ -136,7 +125,7 @@ namespace AzFramework
         auto existingAsset = m_assetIdToInfo.find(id);
         if (existingAsset != m_assetIdToInfo.end())
         {
-            m_assetPathToId.erase(CreateUUIDForName(existingAsset->second.m_relativePath.c_str()));
+            m_assetPathToId.erase(CreateUUIDForName(existingAsset->second.m_relativePath));
         }
         
         m_assetIdToInfo.erase(id);

+ 1 - 1
Code/Framework/AzFramework/AzFramework/Asset/SimpleAsset.h

@@ -85,7 +85,7 @@ namespace AzFramework
                 AZStd::char_traits<char>,
                 AZStd::static_buffer_allocator<128, AZStd::alignment_of<char>::value> >;
 
-    inline const AZ::Uuid SimpleAssetReferenceTypeId = { "{D03D0CF6-9A61-4DBA-AC53-E62453CE940D}" };
+    inline constexpr AZ::Uuid SimpleAssetReferenceTypeId{ "{D03D0CF6-9A61-4DBA-AC53-E62453CE940D}" };
 
     /*!
      * Templated asset reference type.

+ 2 - 2
Code/Framework/AzFramework/AzFramework/Components/CameraBus.h

@@ -260,7 +260,7 @@ namespace Camera
     };
     using CameraNotificationBus = AZ::EBus<CameraNotifications>;
 
-#define CameraComponentTypeId "{E2DC7EB8-02D1-4E6D-BFE4-CE652FCB7C7F}"
-#define EditorCameraComponentTypeId "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D}"
+#define CameraComponentTypeId AZ::TypeId("{E2DC7EB8-02D1-4E6D-BFE4-CE652FCB7C7F}")
+#define EditorCameraComponentTypeId AZ::TypeId("{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D}")
 
 } // namespace Camera

+ 1 - 1
Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp

@@ -685,7 +685,7 @@ namespace AzFramework
         AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(reflection);
         if (serializeContext)
         {
-            serializeContext->ClassDeprecate("NetBindable", "{80206665-D429-4703-B42E-94434F82F381}");
+            serializeContext->ClassDeprecate("NetBindable", AZ::Uuid("{80206665-D429-4703-B42E-94434F82F381}"));
 
             serializeContext->Class<TransformComponent, AZ::Component>()
                 ->Version(5, &TransformComponentVersionConverter)

+ 2 - 2
Code/Framework/AzFramework/AzFramework/DocumentPropertyEditor/DocumentSchema.h

@@ -112,7 +112,7 @@ namespace AZ::DocumentPropertyEditor
         //! Retrieves the name of this attribute, as used as a key in the DOM.
         virtual Name GetName() const = 0;
         //! Gets this attribute's type ID.
-        virtual const AZ::TypeId& GetTypeId() const = 0;
+        virtual AZ::TypeId GetTypeId() const = 0;
         //! Converts this attribute to an AZ::Attribute usable by the ReflectedPropertyEditor.
         virtual AZStd::shared_ptr<AZ::Attribute> DomValueToLegacyAttribute(const AZ::Dom::Value& value) const = 0;
         //! Converts this attribute from an AZ::Attribute to a Dom::Value usable in the DocumentPropertyEditor.
@@ -168,7 +168,7 @@ namespace AZ::DocumentPropertyEditor
             return DomToValue(memberIt->second);
         }
 
-        const AZ::TypeId& GetTypeId() const override
+        AZ::TypeId GetTypeId() const override
         {
             return azrtti_typeid<AttributeType>();
         }

+ 1 - 1
Code/Framework/AzFramework/AzFramework/Physics/Configuration/SimulatedBodyConfiguration.cpp

@@ -44,7 +44,7 @@ namespace AzPhysics
     {
         if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
         {
-            serializeContext->ClassDeprecate("WorldBodyConfiguration", "{6EEB377C-DC60-4E10-AF12-9626C0763B2D}", &Internal::DeprecateWorldBodyConfiguration);
+            serializeContext->ClassDeprecate("WorldBodyConfiguration", AZ::Uuid("{6EEB377C-DC60-4E10-AF12-9626C0763B2D}"), &Internal::DeprecateWorldBodyConfiguration);
             serializeContext->Class<SimulatedBodyConfiguration>()
                 ->Version(2, &Internal::SimulatedBodyVersionConverter)
                 ->Field("name", &SimulatedBodyConfiguration::m_debugName)

+ 1 - 1
Code/Framework/AzFramework/AzFramework/Physics/Material/PhysicsMaterialId.cpp

@@ -22,7 +22,7 @@ namespace Physics
 
     MaterialId MaterialId::CreateData(const void* data, size_t dataSize)
     {
-        return MaterialId(AZ::Uuid::CreateData(data, dataSize));
+        return MaterialId(AZ::Uuid::CreateData(reinterpret_cast<const AZStd::byte*>(data), dataSize));
     }
 
     MaterialId MaterialId::CreateRandom()

+ 1 - 1
Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp

@@ -837,7 +837,7 @@ namespace AzFramework
         if (serializeContext)
         {
             // we may have been reflected by ScriptEditorComponent already, so check first
-            if (serializeContext->FindClassData("{8D1BC97E-C55D-4D34-A460-E63C57CD0D4B}") == nullptr)
+            if (serializeContext->FindClassData(AZ::Uuid("{8D1BC97E-C55D-4D34-A460-E63C57CD0D4B}")) == nullptr)
             {
                 auto converter = [](AZ::SerializeContext&, AZ::SerializeContext::DataElementNode& node)
                 {

+ 1 - 1
Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.cpp

@@ -91,7 +91,7 @@ namespace AzFramework
 
     uint32_t SpawnableAssetHandler::BuildSubId(AZStd::string_view id)
     {
-        AZ::Uuid subIdHash = AZ::Uuid::CreateData(id.data(), id.size());
+        AZ::Uuid subIdHash = AZ::Uuid::CreateData(id);
         return azlossy_caster(subIdHash.GetHash());
     }
 } // namespace AzFramework

+ 3 - 3
Code/Framework/AzFramework/Tests/BehaviorEntityTests.cpp

@@ -12,7 +12,7 @@
 #include <AzFramework/Entity/GameEntityContextBus.h>
 
 // some fake components to test with
-static const AZ::TypeId HatComponentTypeId = "{EADEF936-E987-4BF3-9651-A42251827628}";
+static constexpr AZ::TypeId HatComponentTypeId{ "{EADEF936-E987-4BF3-9651-A42251827628}" };
 
 class HatConfig : public AZ::ComponentConfig
 {
@@ -52,7 +52,7 @@ public:
     HatConfig m_config;
 };
 
-static const AZ::TypeId EarComponentTypeId = "{1F741BC1-451F-445F-891B-1204D6A434D0}";
+static constexpr AZ::TypeId EarComponentTypeId{ "{1F741BC1-451F-445F-891B-1204D6A434D0}" };
 class EarComponent : public AZ::Component
 {
 public:
@@ -64,7 +64,7 @@ public:
     void Deactivate() override {}
 };
 
-static const AZ::TypeId DeactivateDuringActivationComponentTypeId = "{E18A3FFE-FA61-4682-A6C2-FB065D5DDDD2}";
+static constexpr AZ::TypeId DeactivateDuringActivationComponentTypeId{ "{E18A3FFE-FA61-4682-A6C2-FB065D5DDDD2}" };
 class DeactivateDuringActivationComponent : public AZ::Component
 {
 public:

+ 1 - 1
Code/Framework/AzFramework/Tests/Scene.cpp

@@ -45,7 +45,7 @@ namespace SceneUnitTest
         DeactivateFunction m_deactivateFunction = nullptr;
     };
 
-    static const AZ::TypeId TestComponentTypeId = "{DC096267-4815-47D1-BA23-A1CDF0D72D9D}";
+    static constexpr AZ::TypeId TestComponentTypeId{ "{DC096267-4815-47D1-BA23-A1CDF0D72D9D}" };
     class TestComponent : public AZ::Component
     {
     public:

+ 6 - 0
Code/Framework/AzTest/AzTest/Printers.cpp

@@ -8,6 +8,7 @@
 
 #include <AzCore/Component/EntityId.h>
 #include <AzCore/IO/Path/Path.h>
+#include <AzCore/Math/Uuid.h>
 
 #include <ostream>
 
@@ -35,4 +36,9 @@ namespace AZ
     {
         *os << entityId.ToString().c_str();
     }
+
+    void PrintTo(const AZ::Uuid& uuid, ::std::ostream* os)
+    {
+        *os << uuid.ToFixedString().c_str();
+    }
 } // namespace AZ

+ 3 - 0
Code/Framework/AzTest/AzTest/Printers.h

@@ -41,8 +41,11 @@ namespace AZ::IO
 namespace AZ
 {
     class EntityId;
+    struct Uuid;
 
     void PrintTo(AZ::EntityId entityId, ::std::ostream* os);
+
+    void PrintTo(AZ::Uuid& uuid, ::std::ostream* os);
 }
 
 #include <AzTest/Printers.inl>

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetSeedManager.cpp

@@ -592,7 +592,7 @@ namespace AzToolsFramework
                             continue;
                         }
 
-                        hash.ProcessBytes(buffer.data(), buffer.size());
+                        hash.ProcessBytes(AZStd::as_bytes(AZStd::span(buffer)));
                         hash.GetDigest(digestArray);
 
                         for (int idx = 0; idx < digest.size(); idx++)

+ 2 - 2
Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp

@@ -2110,7 +2110,7 @@ namespace AzToolsFramework
                     source = AZStd::move(combined);
                     handler(source);
                     return false;//one
-                }, nullptr,
+                }, {},
                 nullptr);
         }
 
@@ -2123,7 +2123,7 @@ namespace AzToolsFramework
                     source = AZStd::move(combined);
                     handler(source);
                     return false;//one
-                }, nullptr);
+                }, {});
         }
 
         bool AssetDatabaseConnection::QuerySourceBySourceGuid(AZ::Uuid sourceGuid, sourceHandler handler)

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/EditorPrefabComponent.h

@@ -16,7 +16,7 @@ namespace AzToolsFramework
         class EditorPrefabComponent : public AzToolsFramework::Components::EditorComponentBase
         {
         public:
-            static constexpr const char* const EditorPrefabComponentTypeId = "{756E5F9C-3E08-4F8D-855C-A5AEEFB6FCDD}";
+            static inline constexpr AZ::TypeId EditorPrefabComponentTypeId{ "{756E5F9C-3E08-4F8D-855C-A5AEEFB6FCDD}" };
 
             AZ_COMPONENT(EditorPrefabComponent, EditorPrefabComponentTypeId, EditorComponentBase);
 

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.cpp

@@ -43,7 +43,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils
         return m_asset != nullptr;
     }
 
-    const AZ::Data::AssetType& ProcessedObjectStore::GetAssetType() const
+    AZ::Data::AssetType ProcessedObjectStore::GetAssetType() const
     {
         AZ_Assert(m_asset, "Called GetAssetType on ProcessedObjectStore when there was no valid asset.");
         return m_asset->GetType();

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.h

@@ -46,7 +46,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils
         uint32_t GetSubId() const;
 
         bool HasAsset() const;
-        const AZ::Data::AssetType& GetAssetType() const;
+        AZ::Data::AssetType GetAssetType() const;
         const AZ::Data::AssetData& GetAsset() const;
         AZ::Data::AssetData& GetAsset();
         AssetSmartPtr ReleaseAsset();

+ 4 - 4
Code/Framework/AzToolsFramework/AzToolsFramework/SQLite/SQLiteConnection.cpp

@@ -443,13 +443,13 @@ namespace AzToolsFramework
             const void* blobAddr = GetColumnBlob(statement, col);
             int blobBytes = GetColumnBlobBytes(statement, col);
             AZ::Uuid newUuid;
-            AZ_Error("SQLiteConnection", blobAddr && (blobBytes == sizeof(newUuid.data)), "GetColumnUuid: Database column %i does not contain a UUID - could be a sign of a corrupt database.", col);
-            if ((!blobAddr) || (blobBytes != sizeof(newUuid.data)))
+            AZ_Error("SQLiteConnection", blobAddr && (blobBytes == AZStd::ranges::size(newUuid)), "GetColumnUuid: Database column %i does not contain a UUID - could be a sign of a corrupt database.", col);
+            if ((!blobAddr) || (blobBytes != AZStd::ranges::size(newUuid)))
             {
                 return AZ::Uuid::CreateNull();
             }
 
-            memcpy(newUuid.data, blobAddr, blobBytes);
+            memcpy(AZStd::ranges::data(newUuid), blobAddr, blobBytes);
             return newUuid;
         }
 
@@ -639,7 +639,7 @@ namespace AzToolsFramework
             {
                 return false;
             }
-            int res = sqlite3_bind_blob(m_statement, idx, data.data, sizeof(data.data), nullptr);
+            int res = sqlite3_bind_blob(m_statement, idx, AZStd::ranges::data(data), static_cast<int>(AZStd::ranges::size(data)), nullptr);
             AZ_Assert(res == SQLITE_OK, "Statement::BindValueUuid: failed to bind!");
             return (res == SQLITE_OK);
         }

+ 2 - 2
Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/GenericComponentWrapper.cpp

@@ -225,7 +225,7 @@ namespace AzToolsFramework
             }
         }
 
-        const AZ::TypeId& GenericComponentWrapper::GetUnderlyingComponentType() const
+        AZ::TypeId GenericComponentWrapper::GetUnderlyingComponentType() const
         {
             if (m_template)
             {
@@ -366,7 +366,7 @@ namespace AzToolsFramework
         }
     }   // namespace Components
 
-    const AZ::Uuid& GetUnderlyingComponentType(const AZ::Component& component)
+    AZ::TypeId GetUnderlyingComponentType(const AZ::Component& component)
     {
         return component.GetUnderlyingComponentType();
     }

+ 2 - 2
Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/GenericComponentWrapper.h

@@ -56,7 +56,7 @@ namespace AzToolsFramework
             void Init() override;
             void Activate() override;
             void Deactivate() override;
-            const AZ::TypeId& GetUnderlyingComponentType() const override;
+            AZ::TypeId GetUnderlyingComponentType() const override;
 
             // AzFramework::DebugDisplayRequestBus
             void DisplayEntityViewport(
@@ -89,7 +89,7 @@ namespace AzToolsFramework
     /// Returns the component's type ID.
     /// If the component is a GenericComponentWrapper,
     /// then the type ID of the wrapped component is returned.
-    const AZ::Uuid& GetUnderlyingComponentType(const AZ::Component& component);
+    AZ::Uuid GetUnderlyingComponentType(const AZ::Component& component);
 
     /**
      * Find the component of the specified type on an entity.

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/SelectionComponent.cpp

@@ -53,7 +53,7 @@ namespace AzToolsFramework
             if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
             {
                 serializeContext->Class<SelectionComponent, EditorComponentBase>()->Version(2);
-                serializeContext->ClassDeprecate("SelectionComponent", "{73B724FC-43D1-4C75-ACF5-79AA8A3BF89D}");
+                serializeContext->ClassDeprecate("SelectionComponent", AZ::Uuid("{73B724FC-43D1-4C75-ACF5-79AA8A3BF89D}"));
             }
 
             if (AZ::JsonRegistrationContext* jsonRegistration = azrtti_cast<AZ::JsonRegistrationContext*>(context))

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/UIFramework.cpp

@@ -623,7 +623,7 @@ namespace AzToolsFramework
         QVariant qv = action->data();
         if (qv.isValid())
         {
-            AZ::Uuid id(qv.toString().toUtf8());
+            AZ::Uuid id(qv.toString().toUtf8().constData());
             EBUS_EVENT(LegacyFramework::CoreMessageBus, ApplicationShow, id);
         }
     }

+ 2 - 2
Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp

@@ -361,7 +361,7 @@ namespace AzToolsFramework
 
         if (pAssetType)
         {
-            (*pAssetType) = nullptr;
+            (*pAssetType) = {};
         }
 
         if (!pData)
@@ -1352,7 +1352,7 @@ namespace AzToolsFramework
         m_thumbnailCallback = editNotifyCallback;
     }
 
-    const AZ::Uuid& AssetPropertyHandlerDefault::GetHandledType() const
+    AZ::TypeId AssetPropertyHandlerDefault::GetHandledType() const
     {
         return AZ::GetAssetClassId();
     }

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx

@@ -280,7 +280,7 @@ namespace AzToolsFramework
     public:
         AZ_CLASS_ALLOCATOR(AssetPropertyHandlerDefault, AZ::SystemAllocator, 0);
 
-        virtual const AZ::Uuid& GetHandledType() const override;
+        virtual AZ::TypeId GetHandledType() const override;
         virtual AZ::u32 GetHandlerName(void) const override { return AZ_CRC("Asset", 0x02af5a5c); }
         virtual bool IsDefaultHandler() const override { return true; }
         virtual QWidget* GetFirstInTabOrder(PropertyAssetCtrl* widget) override { return widget->GetFirstInTabOrder(); }

+ 2 - 4
Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h

@@ -223,9 +223,9 @@ namespace AzToolsFramework
             return true;
         }
 
-        const AZ::Uuid& GetHandledType() const override
+        AZ::TypeId GetHandledType() const override
         {
-            return nullUuid;
+            return {};
         }
 
         void WriteGUIValuesIntoProperty_Internal(QWidget* widget, InstanceDataNode* node) override
@@ -255,8 +255,6 @@ namespace AzToolsFramework
             }
         }
 
-        // Needed since GetHandledType returns a reference
-        AZ::Uuid nullUuid = AZ::Uuid::CreateNull();
         PropertyEditorToolsSystemInterface::PropertyHandlerId m_registeredDpeHandlerId = PropertyEditorToolsSystemInterface::InvalidHandlerId;
     };
 

+ 2 - 2
Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h

@@ -163,7 +163,7 @@ namespace AzToolsFramework
         virtual void ReadValuesIntoGUI_Internal(QWidget* widget, InstanceDataNode* t) = 0;
         // we define this automatically for you, you don't have to override it.
         virtual bool HandlesType(const AZ::Uuid& id) const = 0;
-        virtual const AZ::Uuid& GetHandledType() const = 0;
+        virtual AZ::TypeId GetHandledType() const = 0;
         virtual QWidget* GetFirstInTabOrder_Internal(QWidget* widget) = 0;
         virtual QWidget* GetLastInTabOrder_Internal(QWidget* widget) = 0;
         virtual void UpdateWidgetInternalTabbing_Internal(QWidget* widget) = 0;
@@ -479,7 +479,7 @@ namespace AzToolsFramework
             return GetHandledType() == id;
         }
 
-        virtual const AZ::Uuid& GetHandledType() const override
+        virtual AZ::TypeId GetHandledType() const override
         {
             return AZ::SerializeTypeInfo<PropertyType>::GetUuid();
         }

+ 1 - 1
Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/SharedViewBookmarkComponent.h

@@ -32,7 +32,7 @@ namespace AzToolsFramework
     class SharedViewBookmarkComponent : public AzToolsFramework::Components::EditorComponentBase
     {
     public:
-        static constexpr const char* const ViewBookmarkComponentTypeId = "{6959832F-9382-4C7D-83AC-380DA9F138DE}";
+        static inline constexpr AZ::TypeId ViewBookmarkComponentTypeId{ "{6959832F-9382-4C7D-83AC-380DA9F138DE}" };
 
         AZ_EDITOR_COMPONENT(SharedViewBookmarkComponent, ViewBookmarkComponentTypeId, EditorComponentBase);
 

+ 2 - 2
Code/Framework/AzToolsFramework/Tests/GenericComponentWrapperTest.cpp

@@ -127,7 +127,7 @@ TEST_F(WrappedEditorComponentTest, ComponentId_MatchesWrapperId)
     EXPECT_EQ(m_componentFromSlice->GetId(), 11874523501682509824u);
 }
 
-const AZ::Uuid InGameOnlyComponentTypeId = "{1D538623-2052-464F-B0DA-D000E1520333}";
+static constexpr AZ::TypeId InGameOnlyComponentTypeId{ "{1D538623-2052-464F-B0DA-D000E1520333}" };
 class InGameOnlyComponent
     : public AZ::Component
 {
@@ -152,7 +152,7 @@ public:
     }
 };
 
-const AZ::Uuid NoneEditorComponentTypeId = "{AE3454BA-D785-4EE2-A55B-A089F2B2916A}";
+static constexpr AZ::Uuid NoneEditorComponentTypeId{ "{AE3454BA-D785-4EE2-A55B-A089F2B2916A}" };
 class NoneEditorComponent
     : public AZ::Component
 {

+ 2 - 2
Code/Framework/AzToolsFramework/Tests/Script/ScriptComponentTests.cpp

@@ -45,10 +45,10 @@ namespace UnitTest
             Entity* systemEntity = m_app.Create(appDesc);
 
             systemEntity->CreateComponent<MemoryComponent>();
-            systemEntity->CreateComponent("{CAE3A025-FAC9-4537-B39E-0A800A2326DF}"); // JobManager component
+            systemEntity->CreateComponent(AZ::TypeId{ "{CAE3A025-FAC9-4537-B39E-0A800A2326DF}" }); // JobManager component
             systemEntity->CreateComponent<StreamerComponent>();
             systemEntity->CreateComponent<AssetManagerComponent>();
-            systemEntity->CreateComponent("{A316662A-6C3E-43E6-BC61-4B375D0D83B4}"); // Usersettings component
+            systemEntity->CreateComponent(AZ::TypeId{ "{A316662A-6C3E-43E6-BC61-4B375D0D83B4}" }); // Usersettings component
             systemEntity->CreateComponent<ScriptSystemComponent>();
 
             systemEntity->Init();

+ 2 - 2
Code/Framework/AzToolsFramework/Tests/SliceUpgradeTests.cpp

@@ -574,7 +574,7 @@ namespace UnitTest
         AZ::Entity* entity = aznew AZ::Entity();
         entity->CreateComponent<TestComponentD_V1>();
         // Supply a specific Asset Guid to help with debugging
-        AZ::Data::AssetId sliceAssetId = SaveAsSlice(entity, "{10000000-0000-0000-0000-000000000000}", "datapatch_base.slice");
+        AZ::Data::AssetId sliceAssetId = SaveAsSlice(entity, AZ::Uuid{ "{10000000-0000-0000-0000-000000000000}" }, "datapatch_base.slice");
         entity = nullptr;
 
         AZ::Entity* instantiatedSliceEntity = InstantiateSlice(sliceAssetId);
@@ -588,7 +588,7 @@ namespace UnitTest
         testComponent->m_firstData = Value1_Override;
         testComponent->m_secondData = Value2_Override;
         testComponent->m_asset = AssetPath_Override;
-        AZ::Data::AssetId nestedSliceAssetId = SaveAsSlice(instantiatedSliceEntity,"{20000000-0000-0000-0000-000000000000}", "datapatch_nested.slice");
+        AZ::Data::AssetId nestedSliceAssetId = SaveAsSlice(instantiatedSliceEntity, AZ::Uuid{ "{20000000-0000-0000-0000-000000000000}" }, "datapatch_nested.slice");
         m_rootSliceComponent->RemoveEntity(instantiatedSliceEntity, true, true);
         instantiatedSliceEntity = nullptr;
 

+ 5 - 5
Code/Framework/AzToolsFramework/Tests/SliceUpgradeTestsData.h

@@ -38,7 +38,7 @@ namespace UnitTest
         }
     };
 
-    static const char* TestComponentATypeId = "{C802148B-7EDC-4518-9780-FB9F99880446}";
+    inline constexpr AZ::TypeId TestComponentATypeId{ "{C802148B-7EDC-4518-9780-FB9F99880446}" };
     class TestComponentA_V0
         : public AzToolsFramework::Components::EditorComponentBase
     {
@@ -129,7 +129,7 @@ namespace UnitTest
         }
     };
 
-    static const char* TestDataB_TypeId = "{20E6777B-6857-409B-B27F-9E505D4378EF}";
+    inline constexpr AZ::TypeId TestDataB_TypeId { "{20E6777B-6857-409B-B27F-9E505D4378EF}" };
 
     struct TestDataB_V0
     {
@@ -239,7 +239,7 @@ namespace UnitTest
         float m_info = 27.5f;
     };
 
-    static const char* TestComponentBTypeId = "{10778D96-4860-4690-9A0E-B1066C00136B}";
+    inline constexpr AZ::TypeId TestComponentBTypeId{ "{10778D96-4860-4690-9A0E-B1066C00136B}" };
 
     class TestComponentB_V0
         : public AzToolsFramework::Components::EditorComponentBase
@@ -359,7 +359,7 @@ namespace UnitTest
         }
     };
 
-    static const char* TestComponentDTypeId = "{77655B67-3E03-418C-B010-D272DBCEAE25}";
+    inline constexpr AZ::TypeId TestComponentDTypeId{ "{77655B67-3E03-418C-B010-D272DBCEAE25}" };
 
     // Initial Test Values
     static const int Value1_Initial = 3;
@@ -507,7 +507,7 @@ namespace UnitTest
     // 2. float (V4) -> int (V5), int (V5) -> double (V6)       // Applies 2 incremental upgrades to upgrade a data patch created using TestComponentE_V4 so that it can be applied to TestComponentE_V6_1 (Expected data loss)
     // 3. float (V4) -> double (V6)                             // Applies a skip-version patch to go directly from TestComponentE_V4 to TestComponentE_V6_2 to avoid the data loss in the previous scenario.
 
-    static const char* TestComponentETypeId = "{835E5A78-2283-4113-91BC-BFC022619388}";
+    inline constexpr AZ::TypeId TestComponentETypeId{ "{835E5A78-2283-4113-91BC-BFC022619388}" };
 
     // Original data for our test TestComponentE_V4
     static const float V4_DefaultData = 3.75f;

+ 5 - 5
Code/Framework/AzToolsFramework/Tests/Viewport/ViewportEditorModeTests.cpp

@@ -322,7 +322,7 @@ namespace UnitTest
     TEST_F(ViewportEditorModeTrackerTestFixture, ActivatingViewportEditorModeForNonExistentIdCreatesViewportEditorModesForThatId)
     {
         // Given a viewport not currently being tracked
-        const TrackerId id = 0;
+        constexpr TrackerId id;
         EXPECT_FALSE(m_viewportEditorModeTracker.IsViewportModeTracked({ id }));
         EXPECT_EQ(m_viewportEditorModeTracker.GetViewportEditorModes({ id }), nullptr);
 
@@ -342,7 +342,7 @@ namespace UnitTest
     TEST_F(ViewportEditorModeTrackerTestFixture, DeactivatingViewportEditorModeForNonExistentIdCreatesViewportEditorModesForThatIdButReturnsError)
     {
         // Given a viewport not currently being tracked
-        const TrackerId id = 0;
+        constexpr TrackerId id;
         EXPECT_FALSE(m_viewportEditorModeTracker.IsViewportModeTracked({ id }));
         EXPECT_EQ(m_viewportEditorModeTracker.GetViewportEditorModes({ id }), nullptr);
 
@@ -368,7 +368,7 @@ namespace UnitTest
 
     TEST_F(ViewportEditorModeTrackerTestFixture, GettingNonExistentViewportEditorModesForIdReturnsNull)
     {
-        const TrackerId id = 0;
+        constexpr TrackerId id;
         EXPECT_FALSE(m_viewportEditorModeTracker.IsViewportModeTracked({ id }));
         EXPECT_EQ(m_viewportEditorModeTracker.GetViewportEditorModes({ id }), nullptr);
     }
@@ -376,7 +376,7 @@ namespace UnitTest
     TEST_F(ViewportEditorModeTrackerTestFixture, ActivatingViewportEditorModesForExistingIdInThatStateReturnsError)
     {
         // Given a viewport not currently tracked
-        const TrackerId id = 0;
+        constexpr TrackerId id;
         EXPECT_FALSE(m_viewportEditorModeTracker.IsViewportModeTracked({ id }));
         EXPECT_EQ(m_viewportEditorModeTracker.GetViewportEditorModes({ id }), nullptr);
 
@@ -416,7 +416,7 @@ namespace UnitTest
     TEST_F(ViewportEditorModeTrackerTestFixture, DeactivatingViewportEditorModesForExistingIdNotInThatStateReturnssError)
     {
         // Given a viewport not currently tracked
-        const TrackerId id = 0;
+        constexpr TrackerId id;
         EXPECT_FALSE(m_viewportEditorModeTracker.IsViewportModeTracked({ id }));
         EXPECT_EQ(m_viewportEditorModeTracker.GetViewportEditorModes({ id }), nullptr);
 

+ 6 - 6
Code/Legacy/CryCommon/Maestro/Bus/SequenceComponentBus.h

@@ -76,7 +76,7 @@ namespace Maestro
             virtual ~AnimatedValue() {};
 
             // Query the type of the value
-            virtual const AZ::Uuid& GetTypeId() const = 0;
+            virtual AZ::TypeId GetTypeId() const = 0;
 
             void GetValue(AZ::Vector3& vector3Value) const
             {
@@ -144,7 +144,7 @@ namespace Maestro
             AnimatedFloatValue(float value = .0f) { m_value = value; }
             ~AnimatedFloatValue() {}
 
-            const AZ::Uuid& GetTypeId() const override
+            AZ::TypeId GetTypeId() const override
             {
                 return AZ::AzTypeInfo<float>::Uuid();
             }
@@ -253,7 +253,7 @@ namespace Maestro
             AnimatedVector3Value(const AZ::Vector3& value) { m_value = value; }
             ~AnimatedVector3Value() {}
 
-            const AZ::Uuid& GetTypeId() const override
+            AZ::TypeId GetTypeId() const override
             {
                 return AZ::Vector3::TYPEINFO_Uuid();
             }
@@ -363,7 +363,7 @@ namespace Maestro
             AnimatedQuaternionValue(const AZ::Quaternion value) { m_value = value; }
             ~AnimatedQuaternionValue() {}
 
-            const AZ::Uuid& GetTypeId() const override
+            AZ::TypeId GetTypeId() const override
             {
                 return AZ::Quaternion::TYPEINFO_Uuid();
             }
@@ -475,7 +475,7 @@ namespace Maestro
             AnimatedBoolValue(bool value) { m_value = value; }
             ~AnimatedBoolValue() {}
 
-            const AZ::Uuid& GetTypeId() const override
+            AZ::TypeId GetTypeId() const override
             {
                 return AZ::AzTypeInfo<bool>::Uuid();
             }
@@ -585,7 +585,7 @@ namespace Maestro
             AnimatedAssetIdValue() { m_value.SetInvalid(); }
             AnimatedAssetIdValue(const AZ::Data::AssetId& value) { m_value = value; }
 
-            const AZ::Uuid& GetTypeId() const override
+            AZ::TypeId GetTypeId() const override
             {
                 return AZ::AzTypeInfo<AZ::Data::AssetId>::Uuid();
             }

+ 4 - 4
Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp

@@ -203,7 +203,7 @@ namespace LegacyLevelSystem
         AZStd::string validLevelName;
         AZ::Data::AssetId rootSpawnableAssetId;
         AZ::Data::AssetCatalogRequestBus::BroadcastResult(
-            rootSpawnableAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, levelName, nullptr, false);
+            rootSpawnableAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, levelName, AZ::Data::AssetType{}, false);
 
         if (rootSpawnableAssetId.IsValid())
         {
@@ -220,7 +220,7 @@ namespace LegacyLevelSystem
 
                 AZ::Data::AssetCatalogRequestBus::BroadcastResult(
                     rootSpawnableAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, possibleLevelAssetPath.c_str(),
-                    nullptr, false);
+                    AZ::Data::AssetType{}, false);
 
                 if (rootSpawnableAssetId.IsValid())
                 {
@@ -281,7 +281,7 @@ namespace LegacyLevelSystem
 
         AZ::Data::AssetId rootSpawnableAssetId;
         AZ::Data::AssetCatalogRequestBus::BroadcastResult(
-            rootSpawnableAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, levelName, nullptr, false);
+            rootSpawnableAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, levelName, AZ::Data::AssetType{}, false);
         if (!rootSpawnableAssetId.IsValid())
         {
             OnLoadingError(levelName, "AssetCatalog has no entry for the requested level.");
@@ -373,7 +373,7 @@ namespace LegacyLevelSystem
     {
         AZ::Data::AssetId rootSpawnableAssetId;
         AZ::Data::AssetCatalogRequestBus::BroadcastResult(
-            rootSpawnableAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, levelName, nullptr, false);
+            rootSpawnableAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, levelName, AZ::Data::AssetType{}, false);
         if (!rootSpawnableAssetId.IsValid())
         {
             // alert the listener

+ 22 - 24
Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp

@@ -708,37 +708,35 @@ namespace AssetBuilderSDK
     static const char* xmlExtensions = ".xml";
     static const char* skeletonExtensions = ".chr";
 
-    static AZ::Data::AssetType unknownAssetType = AZ::Data::AssetType::CreateNull();
+    static constexpr AZ::Data::AssetType unknownAssetType;
 
     // as real BuilderSDK builders are created for these types, they will no longer need to be matched by extension
     // and can be emitted by the builder itself, which has knowledge of the type.
     // first, we'll do the ones which are randomly assigned because they did not actually have an asset type or handler in the main engine yet
-    static AZ::Data::AssetType textureMipsAssetType("{3918728C-D3CA-4D9E-813E-A5ED20C6821E}");
-    static AZ::Data::AssetType skinnedMeshLodsAssetType("{58E5824F-C27B-46FD-AD48-865BA41B7A51}");
-    static AZ::Data::AssetType staticMeshLodsAssetType("{9AAE4926-CB6A-4C60-9948-A1A22F51DB23}");
-    static AZ::Data::AssetType skeletonAssetType("{60161B46-21F0-4396-A4F0-F2CCF0664CDE}");
-    static AZ::Data::AssetType entityIconAssetType("{3436C30E-E2C5-4C3B-A7B9-66C94A28701B}");
+    static constexpr AZ::Data::AssetType textureMipsAssetType("{3918728C-D3CA-4D9E-813E-A5ED20C6821E}");
+    static constexpr AZ::Data::AssetType skinnedMeshLodsAssetType("{58E5824F-C27B-46FD-AD48-865BA41B7A51}");
+    static constexpr AZ::Data::AssetType staticMeshLodsAssetType("{9AAE4926-CB6A-4C60-9948-A1A22F51DB23}");
+    static constexpr AZ::Data::AssetType skeletonAssetType("{60161B46-21F0-4396-A4F0-F2CCF0664CDE}");
+    static constexpr AZ::Data::AssetType entityIconAssetType("{3436C30E-E2C5-4C3B-A7B9-66C94A28701B}");
 
     // now the ones that are actual asset types that already have an AssetData-derived class in the engine
     // note that ideally, all NEW asset types beyond this point are instead built by an actual specific builder-SDK derived builder
     // and thus can emit their own asset types, but for legacy compatibility, this is an alternate means to do this.
-    static AZ::Data::AssetType textureAssetType("{59D5E20B-34DB-4D8E-B867-D33CC2556355}"); // from MaterialAsset.h
-    static AZ::Data::AssetType materialAssetType("{F46985B5-F7FF-4FCB-8E8C-DC240D701841}"); // from MaterialAsset.h
-    static AZ::Data::AssetType meshAssetType("{C2869E3B-DDA0-4E01-8FE3-6770D788866B}"); // from MeshAsset.h
-    static AZ::Data::AssetType skinnedMeshAssetType("{C5D443E1-41FF-4263-8654-9438BC888CB7}"); // from MeshAsset.h
-    static AZ::Data::AssetType sliceAssetType("{C62C7A87-9C09-4148-A985-12F2C99C0A45}"); // from SliceAsset.h
-    static AZ::Data::AssetType dynamicSliceAssetType("{78802ABF-9595-463A-8D2B-D022F906F9B1}"); // from SliceAsset.h
+    static constexpr AZ::Data::AssetType textureAssetType("{59D5E20B-34DB-4D8E-B867-D33CC2556355}"); // from MaterialAsset.h
+    static constexpr AZ::Data::AssetType meshAssetType("{C2869E3B-DDA0-4E01-8FE3-6770D788866B}"); // from MeshAsset.h
+    static constexpr AZ::Data::AssetType skinnedMeshAssetType("{C5D443E1-41FF-4263-8654-9438BC888CB7}"); // from MeshAsset.h
+    static constexpr AZ::Data::AssetType sliceAssetType("{C62C7A87-9C09-4148-A985-12F2C99C0A45}"); // from SliceAsset.h
+    static constexpr AZ::Data::AssetType dynamicSliceAssetType("{78802ABF-9595-463A-8D2B-D022F906F9B1}"); // from SliceAsset.h
 
     // the following Asset Types are discovered in generic XMLs.  in the future, these need to be custom file extensions
     // and this data can move from here to the INI file, or into a custom builder.
-    static AZ::Data::AssetType prefabsLibraryAssetType("{2DC3C556-9461-4729-8313-2BA0CB64EF52}"); // from PrefabsLibraryAssetTypeInfo.cpp
-    static AZ::Data::AssetType entityPrototypeLibraryAssetType("{B034F8AB-D881-4A35-A408-184E3FDEB2FE}"); // from EntityPrototypeLibraryAssetTypeInfo.cpp
-    static AZ::Data::AssetType gameTokenAssetType("{1D4B56F8-366A-4040-B645-AE87E3A00DAB}"); // from GameTokenAssetTypeInfo.cpp
-    static AZ::Data::AssetType particleLibraryAssetType("{99542BB9-2870-4DD0-AA0A-57B5541CD196}");
-    static AZ::Data::AssetType particleAssetType("{6EB56B55-1B58-4EE3-A268-27680338AE56}"); // from ParticleAsset.h
-    static AZ::Data::AssetType lensFlareAssetType("{CF44D1F0-F178-4A3D-A9E6-D44721F50C20}"); // from LensFlareAsset.h
-    static AZ::Data::AssetType fontAssetType("{57767D37-0EBE-43BE-8F60-AB36D2056EF8}"); // form UiAssetTypes.h
-    static AZ::Data::AssetType uiCanvasAssetType("{E48DDAC8-1F1E-4183-AAAB-37424BCC254B}"); // from UiAssetTypes.h
+    static constexpr AZ::Data::AssetType prefabsLibraryAssetType("{2DC3C556-9461-4729-8313-2BA0CB64EF52}"); // from PrefabsLibraryAssetTypeInfo.cpp
+    static constexpr AZ::Data::AssetType entityPrototypeLibraryAssetType("{B034F8AB-D881-4A35-A408-184E3FDEB2FE}"); // from EntityPrototypeLibraryAssetTypeInfo.cpp
+    static constexpr AZ::Data::AssetType gameTokenAssetType("{1D4B56F8-366A-4040-B645-AE87E3A00DAB}"); // from GameTokenAssetTypeInfo.cpp
+    static constexpr AZ::Data::AssetType particleAssetType("{6EB56B55-1B58-4EE3-A268-27680338AE56}"); // from ParticleAsset.h
+    static constexpr AZ::Data::AssetType lensFlareAssetType("{CF44D1F0-F178-4A3D-A9E6-D44721F50C20}"); // from LensFlareAsset.h
+    static constexpr AZ::Data::AssetType fontAssetType("{57767D37-0EBE-43BE-8F60-AB36D2056EF8}"); // form UiAssetTypes.h
+    static constexpr AZ::Data::AssetType uiCanvasAssetType("{E48DDAC8-1F1E-4183-AAAB-37424BCC254B}"); // from UiAssetTypes.h
 
     // EMotionFX Gem types
     // If we have a way to register gem specific asset type in the future, we can remove this.
@@ -746,10 +744,10 @@ namespace AssetBuilderSDK
     static const char* emotionFXMotionExtension = ".motion";
     static const char* emotionFXMotionSetExtension = ".motionset";
     static const char* emotionFXAnimGraphExtension = ".animgraph";
-    static AZ::Data::AssetType emotionFXActorAssetType("{F67CC648-EA51-464C-9F5D-4A9CE41A7F86}"); // from ActorAsset.h in EMotionFX Gem
-    static AZ::Data::AssetType emotionFXMotionAssetType("{00494B8E-7578-4BA2-8B28-272E90680787}"); // from MotionAsset.h in EMotionFX Gem
-    static AZ::Data::AssetType emotionFXMotionSetAssetType("{1DA936A0-F766-4B2F-B89C-9F4C8E1310F9}"); // from MotionSetAsset.h in EMotionFX Gem
-    static AZ::Data::AssetType emotionFXAnimGraphAssetType("{28003359-4A29-41AE-8198-0AEFE9FF5263}"); // from AnimGraphAsset.h in EMotionFX Gem
+    static constexpr AZ::Data::AssetType emotionFXActorAssetType("{F67CC648-EA51-464C-9F5D-4A9CE41A7F86}"); // from ActorAsset.h in EMotionFX Gem
+    static constexpr AZ::Data::AssetType emotionFXMotionAssetType("{00494B8E-7578-4BA2-8B28-272E90680787}"); // from MotionAsset.h in EMotionFX Gem
+    static constexpr AZ::Data::AssetType emotionFXMotionSetAssetType("{1DA936A0-F766-4B2F-B89C-9F4C8E1310F9}"); // from MotionSetAsset.h in EMotionFX Gem
+    static constexpr AZ::Data::AssetType emotionFXAnimGraphAssetType("{28003359-4A29-41AE-8198-0AEFE9FF5263}"); // from AnimGraphAsset.h in EMotionFX Gem
 
     AZ::Data::AssetType JobProduct::InferAssetTypeByProductFileName(const char* productFile)
     {

+ 1 - 1
Code/Tools/AssetProcessor/native/tests/AssetCatalog/AssetCatalogUnitTests.cpp

@@ -1061,7 +1061,7 @@ namespace AssetProcessor
         );
 
         AssetNotificationMessage message("some/path/image.png", AssetNotificationMessage::NotificationType::AssetChanged, AZ::Data::AssetType::CreateRandom(), "pc");
-        message.m_assetId = { "{C1A73521-E770-475F-8D91-30DF88E4D4C9}" };
+        message.m_assetId = AZ::Data::AssetId{ "{C1A73521-E770-475F-8D91-30DF88E4D4C9}" };
 
         for (int i = 0; i < NumUpdateIterations; ++i)
         {

+ 2 - 2
Code/Tools/AssetProcessor/native/unittests/AssetProcessorManagerUnitTests.cpp

@@ -101,8 +101,8 @@ namespace AssetProcessor
 
             //Calculating fingerprints for the file for pc and android platforms
             AZ::Uuid sourceId = AZ::Uuid("{2206A6E0-FDBC-45DE-B6FE-C2FC63020BD5}");
-            JobEntry jobEntryPC(scanFolderPath, relPath, relPath, 0, { "pc", {"desktop", "renderer"} }, "", 0, 1, sourceId);
-            JobEntry jobEntryANDROID(scanFolderPath, relPath, relPath, 0, { "android", {"mobile", "renderer"} }, "", 0, 2, sourceId);
+            JobEntry jobEntryPC(scanFolderPath, relPath, relPath, {}, { "pc", {"desktop", "renderer"} }, "", 0, 1, sourceId);
+            JobEntry jobEntryANDROID(scanFolderPath, relPath, relPath, {}, { "android", {"mobile", "renderer"} }, "", 0, 2, sourceId);
 
             JobDetails jobDetailsPC;
             jobDetailsPC.m_extraInformationForFingerprinting = extraInfoForPC.toUtf8().constData();

+ 1 - 2
Code/Tools/AssetProcessor/native/unittests/BuilderSDKUnitTests.cpp

@@ -208,11 +208,10 @@ namespace UnitTest
 
         {
             UnitTestUtils::AssertAbsorber absorber;
-            // objectstream with invalid 'type' inside the class
+            // objectstream with an empty string 'type' inside the class
             EXPECT_TRUE(UnitTestUtils::CreateDummyFile(dummyFileName, "<ObjectStream><Class type=\"\"/></ObjectStream>"));
             EXPECT_EQ(
                 AssetBuilderSDK::JobProduct::InferAssetTypeByProductFileName(dummyFileName.toUtf8().data()), AZ::Uuid::CreateNull());
-            EXPECT_GT(absorber.m_numWarningsAbsorbed, 0);
         }
 
         {

+ 1 - 1
Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp

@@ -1061,7 +1061,7 @@ namespace AssetUtilities
         }
 
         AZ::Sha1 sha;
-        sha.ProcessBytes(fingerprintString.data(), fingerprintString.size());
+        sha.ProcessBytes(AZStd::as_bytes(AZStd::span(fingerprintString)));
         AZ::u32 digest[5];
         sha.GetDigest(digest);
 

+ 1 - 1
Code/Tools/LuaIDE/Source/LUA/WatchesPanel.cpp

@@ -364,7 +364,7 @@ void WatchesDataModel::AddWatch(AZStd::string newName)
     dv.m_name = newName;
     dv.m_value = "<invalid>";
     dv.m_type = LUA_TNONE;
-    dv.m_typeId = 0;
+    dv.m_typeId = {};
     dv.m_flags = 0;
 
     AddWatch(dv);

+ 1 - 1
Code/Tools/SceneAPI/SDKWrapper/AssImpMaterialWrapper.cpp

@@ -45,7 +45,7 @@ namespace AZ
                 m_assImpMaterial->GetTextureCount(aiTextureType_AMBIENT), m_assImpMaterial->GetTextureCount(aiTextureType_EMISSIVE));
             fingerprintString.append(extraInformation);
             AZ::Sha1 sha;
-            sha.ProcessBytes(fingerprintString.data(), fingerprintString.size());
+            sha.ProcessBytes(AZStd::as_bytes(AZStd::span(fingerprintString)));
             AZ::u32 digest[5]; //sha1 populate a 5 element array of AZ:u32
             sha.GetDigest(digest);
             return (static_cast<AZ::u64>(digest[0]) << 32) | digest[1];

+ 1 - 1
Code/Tools/SceneAPI/SDKWrapper/AssImpNodeWrapper.cpp

@@ -40,7 +40,7 @@ namespace AZ
             AZStd::string extraInformation = AZStd::string::format("%i%i", m_assImpNode->mNumChildren, m_assImpNode->mNumMeshes);
             fingerprintString.append(extraInformation);
             AZ::Sha1 sha;
-            sha.ProcessBytes(fingerprintString.data(), fingerprintString.size());
+            sha.ProcessBytes(AZStd::as_bytes(AZStd::span(fingerprintString)));
             AZ::u32 digest[5]; //sha1 populate a 5 element array of AZ:u32
             sha.GetDigest(digest);
             return (static_cast<AZ::u64>(digest[0]) << 32) | digest[1];

+ 4 - 7
Code/Tools/SceneAPI/SceneCore/DataTypes/DataTypeUtilities.cpp

@@ -94,7 +94,7 @@ namespace AZ
                     return result;
                 }
 
-                AZStd::string CreateUniqueName(const AZStd::string& baseName, const AZStd::string& subName, 
+                AZStd::string CreateUniqueName(const AZStd::string& baseName, const AZStd::string& subName,
                     const Containers::SceneManifest& manifest, const Uuid& type)
                 {
                     return CreateUniqueName(AZStd::string::format("%s_%s", baseName.c_str(), subName.c_str()), manifest, type);
@@ -102,10 +102,7 @@ namespace AZ
 
                 Uuid CreateStableUuid(const Containers::Scene& scene, const Uuid& typeId)
                 {
-                    char guid[sizeof(Uuid) * 2];
-                    memcpy(guid, scene.GetSourceGuid().data, sizeof(Uuid));
-                    memcpy(guid + sizeof(Uuid), typeId.data, sizeof(Uuid));
-                    return Uuid::CreateData(guid, sizeof(Uuid) * 2);
+                    return scene.GetSourceGuid() + typeId;
                 }
 
                 Uuid CreateStableUuid(const Containers::Scene& scene, const Uuid& typeId, const AZStd::string& subId)
@@ -115,7 +112,7 @@ namespace AZ
                     guid += typeId.ToString<AZStd::string>();
                     guid += subId;
 
-                    return Uuid::CreateData(guid.data(), guid.size() * sizeof(guid[0]));
+                    return Uuid::CreateData(guid);
                 }
 
                 Uuid CreateStableUuid(const Containers::Scene& scene, const Uuid& typeId, const char* subId)
@@ -125,7 +122,7 @@ namespace AZ
                     guid += typeId.ToString<AZStd::string>();
                     guid += subId;
 
-                    return Uuid::CreateData(guid.data(), guid.size() * sizeof(guid[0]));
+                    return Uuid::CreateData(guid);
                 }
             } // namespace Utilities
         } // namespace DataTypes

+ 5 - 5
Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/PresetSettings.h

@@ -37,10 +37,10 @@ namespace ImageProcessingAtom
         PresetSettings& operator= (const PresetSettings& other);
         bool operator== (const PresetSettings& other) const;
         static void Reflect(AZ::ReflectContext* context);
-        
+
         // unique id for the preset
         // this uuid will be deprecated. The preset name will be used as an unique id for the preset
-        AZ::Uuid m_uuid = 0;
+        AZ::Uuid m_uuid;
 
         PresetName m_name;
 
@@ -91,7 +91,7 @@ namespace ImageProcessingAtom
 
         //settings for mipmap generation. it's null if this preset disable mipmap.
         AZStd::unique_ptr<MipmapSettings> m_mipmapSetting;
-        
+
         //"glossfromnormals". Bake normal variance into smoothness stored in alpha channel
         AZ::u32 m_glossFromNormals = 0;
 
@@ -116,7 +116,7 @@ namespace ImageProcessingAtom
     protected:
         void DeepCopyMembers(const PresetSettings& other);
     };
-    
+
     class MultiplatformPresetSettings
     {
     public:
@@ -144,7 +144,7 @@ namespace ImageProcessingAtom
         PresetSettings m_defaultPreset;
         AZStd::unordered_map<PlatformName, PresetSettings> m_presets;
     };
-    
+
 } // namespace ImageProcessingAtom
 
 namespace AZ

+ 3 - 4
Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.cpp

@@ -24,8 +24,7 @@ namespace ImageProcessingAtom
     const char* TextureSettings::ExtensionName = ".assetinfo";
 
     TextureSettings::TextureSettings()
-        : m_presetId(0)
-        , m_sizeReduceLevel(0)
+        : m_sizeReduceLevel(0)
         , m_suppressEngineReduce(false)
         , m_enableMipmap(true)
         , m_maintainAlphaCoverage(false)
@@ -231,7 +230,7 @@ namespace ImageProcessingAtom
 
         // If the suggested preset doesn't exist (or was failed to be loaded), return empty texture settings
         if (BuilderSettingManager::Instance()->GetPreset(suggestedPreset) == nullptr)
-        {            
+        {
             AZ_Error("Image Processing", false, "Failed to find suggested preset [%s]", suggestedPreset.GetCStr());
             return settings;
         }
@@ -273,7 +272,7 @@ namespace ImageProcessingAtom
         {
             textureSettingsOut = baseTextureSettings;
         }
-        
+
         return STRING_OUTCOME_SUCCESS;
     }
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 174 - 174
Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CCubeMapProcessor.cpp


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott