[LYN-9039] Object stream write response change (#7085)

* Updated the ObjectStreamWriteOverride Callback to return a
ObjectStreamWriteOverrideResponse.

The ObjectStreamWriteOverrideResponse allows the callback to indicate
that the default ObjectStream::WriteElement behavior should occur if the
callback hasn't implemented the write itself.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Fixed forward declaration not matching actual enum class name

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add unit tests

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Remove unused member

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add virtual destructor for test class

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Change string literal to not have tabs in it

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
amzn-mike
2022-01-25 12:58:17 -06:00
committed by GitHub
parent a3cb6b8c5b
commit 956a1e59bb
5 changed files with 142 additions and 7 deletions
@@ -15,7 +15,7 @@ namespace AzFramework
{
// Redirects writing of the AssetBundleManifest to an older version if the bundle version
// is not set to the current version
static void OldBundleManifestWriter(AZ::SerializeContext::EnumerateInstanceCallContext& callContext, const void* bundleManifestPointer,
static AZ::ObjectStreamWriteOverrideResponse OldBundleManifestWriter(AZ::SerializeContext::EnumerateInstanceCallContext& callContext, const void* bundleManifestPointer,
const AZ::SerializeContext::ClassData&, const AZ::SerializeContext::ClassElement* assetBundleManifestClassElement);
static bool BundleManifestVersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& rootElement);
@@ -67,7 +67,7 @@ namespace AzFramework
return true;
}
void OldBundleManifestWriter(AZ::SerializeContext::EnumerateInstanceCallContext& callContext, const void* bundleManifestPointer,
AZ::ObjectStreamWriteOverrideResponse OldBundleManifestWriter(AZ::SerializeContext::EnumerateInstanceCallContext& callContext, const void* bundleManifestPointer,
const AZ::SerializeContext::ClassData&, const AZ::SerializeContext::ClassElement* assetBundleManifestClassElement)
{
// Copy the AssetBundleManifest current version instance to the AssetBundleManifest V2 instance
@@ -145,7 +145,10 @@ namespace AzFramework
ReflectAssetBundleManifestV2(serializeContext);
serializeContext->DisableRemoveReflection();
AssetBundleManifest::ReflectSerialize(serializeContext);
return AZ::ObjectStreamWriteOverrideResponse::CompletedWrite;
}
return AZ::ObjectStreamWriteOverrideResponse::FallbackToDefaultWrite;
}
const AZStd::vector<AZ::IO::Path>& AssetBundleManifest::GetLevelDirectories() const