Files
o3de/Code/Framework/AzFramework/AzFramework/StreamingInstall/StreamingInstallNotifications.h
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

75 lines
4.2 KiB
C++

/*
* 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
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
#include <AzCore/std/string/string.h>
namespace AzFramework
{
namespace StreamingInstall
{
////////////////////////////////////////////////////////////////////////////////////////
class StreamingInstallChunkNotifications : public AZ::EBusTraits
{
public:
////////////////////////////////////////////////////////////////////////////////////////////
//! EBus Trait: StreaimingInstall chunk notifications can be handled by multiple listeners
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
////////////////////////////////////////////////////////////////////////////////////////////
//! EBus Trait: StreamingInstall chunk notifications are addressed to multiple addresses
//! Events that are addressed to an ID are received by handlers that are connected to that ID
typedef AZStd::string BusIdType;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
////////////////////////////////////////////////////////////////////////////////////////////
//! Override to be notified when a chunk has completed downloading. This is a responce from
//! the RegisterChunkInstalledCallbacks event emitted from the platform implementation
//! \param[in] the ID for the chunk that has downloaded
virtual void OnChunkDownloadComplete(const AZStd::string& chunkId) = 0;
////////////////////////////////////////////////////////////////////////////////////////////
//! Override to be notified when a chunk's download progress has changed. This is a responce
//! from the StreamingInstallRequests::BroadcastChunkProgress event
//! \param[in] the ID for the monitored chunk, the current download progress as a 0.0 to 1.0 value
virtual void OnChunkProgressChanged(const AZStd::string& chunkId, float progress) = 0;
////////////////////////////////////////////////////////////////////////////////////////////
//! Override to be notified if a chunk has been installed. This is a responce
//! from the StreamingInstallRequests::IsChunkInstalled event
//! \param[in] the ID of the chunk to query, installed flag for the chunk (true if installed and false otherwise).
virtual void OnQueryChunkInstalled(const AZStd::string& chunkId, bool installed) = 0;
};
using StreamingInstallChunkNotificationBus = AZ::EBus<StreamingInstallChunkNotifications>;
////////////////////////////////////////////////////////////////////////////////////////
class StreamingInstallPackageNotifications : public AZ::EBusTraits
{
public:
////////////////////////////////////////////////////////////////////////////////////////////
//! EBus Trait: StreaimingInstall package notifications can be handled by multiple listeners
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
////////////////////////////////////////////////////////////////////////////////////////////
//! EBus Trait: StreamingInstall package notifications are addressed to a single address
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
////////////////////////////////////////////////////////////////////////////////////////////
//! Override to be notified the packages download progress has changed. This is a response
//! from the StreamingInstallRequests::BroadcastOverallProgress event
//! \param[in] the current download progress for the entire package as a 0.0 to 1.0 value
virtual void OnPackageProgressChanged(float progress) = 0;
};
using StreamingInstallPackageNotificationBus = AZ::EBus<StreamingInstallPackageNotifications>;
} //namespace StreamingInstall
}